
(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 16 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 (let* ((t_0 (/ (* M D) (* 2.0 d)))) (* w0 (sqrt (+ 1.0 (* (/ t_0 l) (/ t_0 (/ -1.0 h))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
return w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
}
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
t_0 = (m * d) / (2.0d0 * d_1)
code = w0 * sqrt((1.0d0 + ((t_0 / l) * (t_0 / ((-1.0d0) / h)))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
return w0 * Math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
}
def code(w0, M, D, h, l, d): t_0 = (M * D) / (2.0 * d) return w0 * math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))))
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) return Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(t_0 / l) * Float64(t_0 / Float64(-1.0 / h)))))) end
function tmp = code(w0, M, D, h, l, d) t_0 = (M * D) / (2.0 * d); tmp = w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h))))); end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 + N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
w0 \cdot \sqrt{1 + \frac{t\_0}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}}
\end{array}
\end{array}
Initial program 81.5%
clear-numN/A
un-div-invN/A
unpow2N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.2
Applied egg-rr93.2%
Final simplification93.2%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 2.0) w0 (* w0 (sqrt (fma -0.25 (/ (* (* M D) (* (* M D) h)) (* d (* d l))) 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 2.0) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma(-0.25, (((M * D) * ((M * D) * h)) / (d * (d * l))), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) <= 2.0) tmp = w0; else tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(Float64(M * D) * Float64(Float64(M * D) * h)) / Float64(d * Float64(d * l))), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], w0, N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 2:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot h\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 2Initial program 99.8%
Taylor expanded in M around 0
Simplified99.8%
if 2 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 51.6%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.7
Simplified51.7%
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr67.5%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6473.4
Applied egg-rr73.4%
Final simplification89.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -20.0) (* w0 (sqrt (fma -0.25 (* (* M (* D h)) (/ (* M D) (* d (* d l)))) 1.0))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -20.0) {
tmp = w0 * sqrt(fma(-0.25, ((M * (D * h)) * ((M * D) / (d * (d * l)))), 1.0));
} else {
tmp = w0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -20.0) tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(M * Float64(D * h)) * Float64(Float64(M * D) / Float64(d * Float64(d * l)))), 1.0))); else tmp = w0; end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -20.0], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(M * N[(D * h), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -20:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(M \cdot \left(D \cdot h\right)\right) \cdot \frac{M \cdot D}{d \cdot \left(d \cdot \ell\right)}, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -20Initial program 69.5%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.8
Simplified52.8%
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.6%
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6471.1
Applied egg-rr71.1%
if -20 < (*.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
Simplified96.3%
Final simplification89.2%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -20.0) (* w0 (sqrt (fma -0.25 (* (* M D) (* h (/ (* M D) (* l (* d d))))) 1.0))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -20.0) {
tmp = w0 * sqrt(fma(-0.25, ((M * D) * (h * ((M * D) / (l * (d * d))))), 1.0));
} else {
tmp = w0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -20.0) tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(M * D) * Float64(h * Float64(Float64(M * D) / Float64(l * Float64(d * d))))), 1.0))); else tmp = w0; end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -20.0], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(M * D), $MachinePrecision] * N[(h * N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -20:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(M \cdot D\right) \cdot \left(h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot d\right)}\right), 1\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -20Initial program 69.5%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.8
Simplified52.8%
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.6%
times-fracN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6469.2
Applied egg-rr69.2%
associate-*r/N/A
associate-/l/N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6464.1
Applied egg-rr64.1%
if -20 < (*.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
Simplified96.3%
Final simplification87.2%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -20.0) (* w0 (sqrt (fma (/ (* D (* D (* M M))) (* l (* d d))) (* h -0.25) 1.0))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -20.0) {
tmp = w0 * sqrt(fma(((D * (D * (M * M))) / (l * (d * d))), (h * -0.25), 1.0));
} else {
tmp = w0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -20.0) tmp = Float64(w0 * sqrt(fma(Float64(Float64(D * Float64(D * Float64(M * M))) / Float64(l * Float64(d * d))), Float64(h * -0.25), 1.0))); else tmp = w0; end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -20.0], N[(w0 * N[Sqrt[N[(N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.25), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -20:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}, h \cdot -0.25, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -20Initial program 69.5%
clear-numN/A
un-div-invN/A
unpow2N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.4
Applied egg-rr81.4%
Taylor expanded in M around 0
+-commutativeN/A
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified54.3%
if -20 < (*.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
Simplified96.3%
Final simplification84.5%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+54) (* w0 (sqrt (/ (* (* -0.25 (* D D)) (* M (* M h))) (* l (* d d))))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+54) {
tmp = w0 * sqrt((((-0.25 * (D * D)) * (M * (M * h))) / (l * (d * d))));
} else {
tmp = w0;
}
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) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-2d+54)) then
tmp = w0 * sqrt(((((-0.25d0) * (d * d)) * (m * (m * h))) / (l * (d_1 * d_1))))
else
tmp = w0
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) / (2.0 * d)), 2.0) * (h / l)) <= -2e+54) {
tmp = w0 * Math.sqrt((((-0.25 * (D * D)) * (M * (M * h))) / (l * (d * d))));
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+54: tmp = w0 * math.sqrt((((-0.25 * (D * D)) * (M * (M * h))) / (l * (d * d)))) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+54) tmp = Float64(w0 * sqrt(Float64(Float64(Float64(-0.25 * Float64(D * D)) * Float64(M * Float64(M * h))) / Float64(l * Float64(d * d))))); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -2e+54) tmp = w0 * sqrt((((-0.25 * (D * D)) * (M * (M * h))) / (l * (d * d)))); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+54], N[(w0 * N[Sqrt[N[(N[(N[(-0.25 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+54}:\\
\;\;\;\;w0 \cdot \sqrt{\frac{\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell \cdot \left(d \cdot d\right)}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -2.0000000000000002e54Initial program 68.2%
clear-numN/A
un-div-invN/A
unpow2N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6480.6
Applied egg-rr80.6%
Taylor expanded in M around inf
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.1
Simplified50.1%
if -2.0000000000000002e54 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.5%
Taylor expanded in M around 0
Simplified94.9%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e+156) (fma (/ (* (* M (* D D)) (* M (* h -0.125))) (* d (* d l))) w0 w0) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+156) {
tmp = fma((((M * (D * D)) * (M * (h * -0.125))) / (d * (d * l))), w0, w0);
} else {
tmp = w0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+156) tmp = fma(Float64(Float64(Float64(M * Float64(D * D)) * Float64(M * Float64(h * -0.125))) / Float64(d * Float64(d * l))), w0, w0); else tmp = w0; end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+156], N[(N[(N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w0 + w0), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+156}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0, w0\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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.99999999999999992e156Initial program 64.7%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.7
Simplified54.7%
Taylor expanded in D around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified49.5%
distribute-rgt-inN/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6454.8
Applied egg-rr54.8%
if -4.99999999999999992e156 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.9%
Taylor expanded in M around 0
Simplified91.7%
Final simplification82.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+264) (fma D (* w0 (* D (* (* M h) (* M (/ -0.125 (* d (* d l))))))) w0) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+264) {
tmp = fma(D, (w0 * (D * ((M * h) * (M * (-0.125 / (d * (d * l))))))), w0);
} else {
tmp = w0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+264) tmp = fma(D, Float64(w0 * Float64(D * Float64(Float64(M * h) * Float64(M * Float64(-0.125 / Float64(d * Float64(d * l))))))), w0); else tmp = w0; end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+264], N[(D * N[(w0 * N[(D * N[(N[(M * h), $MachinePrecision] * N[(M * N[(-0.125 / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+264}:\\
\;\;\;\;\mathsf{fma}\left(D, w0 \cdot \left(D \cdot \left(\left(M \cdot h\right) \cdot \left(M \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\right)}\right)\right)\right), w0\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -2.00000000000000009e264Initial program 62.9%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.8
Simplified55.8%
Taylor expanded in D around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified52.0%
distribute-rgt-inN/A
associate-*l*N/A
associate-*l*N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr58.0%
if -2.00000000000000009e264 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 87.1%
Taylor expanded in M around 0
Simplified90.5%
Final simplification83.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+264) (* w0 (fma (* D (* (* M h) (* M (/ -0.125 (* d (* d l)))))) D 1.0)) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+264) {
tmp = w0 * fma((D * ((M * h) * (M * (-0.125 / (d * (d * l)))))), D, 1.0);
} else {
tmp = w0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+264) tmp = Float64(w0 * fma(Float64(D * Float64(Float64(M * h) * Float64(M * Float64(-0.125 / Float64(d * Float64(d * l)))))), D, 1.0)); else tmp = w0; end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+264], N[(w0 * N[(N[(D * N[(N[(M * h), $MachinePrecision] * N[(M * N[(-0.125 / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + 1.0), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+264}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot \left(\left(M \cdot h\right) \cdot \left(M \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\right)}\right)\right), D, 1\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -2.00000000000000009e264Initial program 62.9%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.8
Simplified55.8%
Taylor expanded in D around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified52.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6458.0
Applied egg-rr58.0%
if -2.00000000000000009e264 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 87.1%
Taylor expanded in M around 0
Simplified90.5%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+302) (* w0 (fma (* D D) (* (* M M) (* h (/ -0.125 (* d (* d l))))) 1.0)) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302) {
tmp = w0 * fma((D * D), ((M * M) * (h * (-0.125 / (d * (d * l))))), 1.0);
} else {
tmp = w0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+302) tmp = Float64(w0 * fma(Float64(D * D), Float64(Float64(M * M) * Float64(h * Float64(-0.125 / Float64(d * Float64(d * l))))), 1.0)); else tmp = w0; end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[(h * N[(-0.125 / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+302}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot D, \left(M \cdot M\right) \cdot \left(h \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\right)}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -2.0000000000000002e302Initial program 62.2%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.7
Simplified56.7%
Taylor expanded in D around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified52.9%
associate-/l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6452.9
Applied egg-rr52.9%
if -2.0000000000000002e302 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 87.2%
Taylor expanded in M around 0
Simplified90.1%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+302) (* w0 (* (* D D) (/ (* -0.125 (* h (* M M))) (* d (* d l))))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302) {
tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (d * (d * l))));
} else {
tmp = w0;
}
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) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-2d+302)) then
tmp = w0 * ((d * d) * (((-0.125d0) * (h * (m * m))) / (d_1 * (d_1 * l))))
else
tmp = w0
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) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302) {
tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (d * (d * l))));
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302: tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (d * (d * l)))) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+302) tmp = Float64(w0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(h * Float64(M * M))) / Float64(d * Float64(d * l))))); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -2e+302) tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (d * (d * l)))); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+302}:\\
\;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -2.0000000000000002e302Initial program 62.2%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.7
Simplified56.7%
Taylor expanded in D around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified52.9%
Taylor expanded in D around inf
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.9
Simplified50.9%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6454.5
Applied egg-rr54.5%
if -2.0000000000000002e302 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 87.2%
Taylor expanded in M around 0
Simplified90.1%
Final simplification82.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+302) (* w0 (* (* D D) (/ (* -0.125 (* h (* M M))) (* l (* d d))))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302) {
tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (l * (d * d))));
} else {
tmp = w0;
}
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) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-2d+302)) then
tmp = w0 * ((d * d) * (((-0.125d0) * (h * (m * m))) / (l * (d_1 * d_1))))
else
tmp = w0
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) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302) {
tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (l * (d * d))));
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302: tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (l * (d * d)))) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+302) tmp = Float64(w0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(h * Float64(M * M))) / Float64(l * Float64(d * d))))); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -2e+302) tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (l * (d * d)))); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+302}:\\
\;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -2.0000000000000002e302Initial program 62.2%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.7
Simplified56.7%
Taylor expanded in D around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified52.9%
Taylor expanded in D around inf
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.9
Simplified50.9%
if -2.0000000000000002e302 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 87.2%
Taylor expanded in M around 0
Simplified90.1%
Final simplification81.2%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+302) (* w0 (* (* D D) (* (* (* M M) -0.125) (/ h (* l (* d d)))))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302) {
tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (l * (d * d)))));
} else {
tmp = w0;
}
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) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-2d+302)) then
tmp = w0 * ((d * d) * (((m * m) * (-0.125d0)) * (h / (l * (d_1 * d_1)))))
else
tmp = w0
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) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302) {
tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (l * (d * d)))));
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+302: tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (l * (d * d))))) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+302) tmp = Float64(w0 * Float64(Float64(D * D) * Float64(Float64(Float64(M * M) * -0.125) * Float64(h / Float64(l * Float64(d * d)))))); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -2e+302) tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (l * (d * d))))); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(h / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+302}:\\
\;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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)) < -2.0000000000000002e302Initial program 62.2%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.7
Simplified56.7%
Taylor expanded in D around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified52.9%
Taylor expanded in D around inf
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.9
Simplified50.9%
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6449.3
Applied egg-rr49.3%
if -2.0000000000000002e302 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 87.2%
Taylor expanded in M around 0
Simplified90.1%
Final simplification80.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* 2.0 d)) 1e-179) w0 (* w0 (sqrt (fma -0.25 (/ (* (* M D) (/ (* M (* D h)) (* d l))) d) 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 1e-179) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma(-0.25, (((M * D) * ((M * (D * h)) / (d * l))) / d), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 1e-179) tmp = w0; else tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(Float64(M * D) * Float64(Float64(M * Float64(D * h)) / Float64(d * l))) / d), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 1e-179], w0, N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * N[(D * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 10^{-179}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M \cdot D\right) \cdot \frac{M \cdot \left(D \cdot h\right)}{d \cdot \ell}}{d}, 1\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) < 1e-179Initial program 85.7%
Taylor expanded in M around 0
Simplified80.6%
if 1e-179 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) Initial program 72.6%
Taylor expanded in w0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.5
Simplified48.5%
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr72.9%
times-fracN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.7
Applied egg-rr79.7%
Final simplification80.3%
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (/ (/ (* M D) (* 2.0 d)) l) (/ (* (* M D) h) (* 2.0 d)))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) / l) * (((M * D) * h) / (2.0 * d)))));
}
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)) / l) * (((m * d) * h) / (2.0d0 * d_1)))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - ((((M * D) / (2.0 * d)) / l) * (((M * D) * h) / (2.0 * d)))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((((M * D) / (2.0 * d)) / l) * (((M * D) * h) / (2.0 * d)))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(M * D) / Float64(2.0 * d)) / l) * Float64(Float64(Float64(M * D) * h) / Float64(2.0 * d)))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) / l) * (((M * D) * h) / (2.0 * d))))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot h}{2 \cdot d}}
\end{array}
Initial program 81.5%
clear-numN/A
un-div-invN/A
unpow2N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.2
Applied egg-rr93.2%
div-invN/A
remove-double-divN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6491.6
Applied egg-rr91.6%
(FPCore (w0 M D h l d) :precision binary64 w0)
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
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
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
def code(w0, M, D, h, l, d): return w0
function code(w0, M, D, h, l, d) return w0 end
function tmp = code(w0, M, D, h, l, d) tmp = w0; end
code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
\\
w0
\end{array}
Initial program 81.5%
Taylor expanded in M around 0
Simplified70.7%
herbie shell --seed 2024199
(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))))))