
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (pow (/ (cbrt A) (* (cbrt V) (cbrt l))) 1.5)))
double code(double c0, double A, double V, double l) {
return c0 * pow((cbrt(A) / (cbrt(V) * cbrt(l))), 1.5);
}
public static double code(double c0, double A, double V, double l) {
return c0 * Math.pow((Math.cbrt(A) / (Math.cbrt(V) * Math.cbrt(l))), 1.5);
}
function code(c0, A, V, l) return Float64(c0 * (Float64(cbrt(A) / Float64(cbrt(V) * cbrt(l))) ^ 1.5)) end
code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[Power[A, 1/3], $MachinePrecision] / N[(N[Power[V, 1/3], $MachinePrecision] * N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Initial program 68.5%
associate-/r*70.6%
div-inv70.6%
Applied egg-rr70.6%
pow1/270.6%
metadata-eval70.6%
pow-pow66.4%
un-div-inv66.4%
associate-/r*64.5%
pow1/368.0%
Applied egg-rr68.0%
associate-/r*70.1%
Simplified70.1%
cbrt-div83.7%
div-inv83.6%
cbrt-div97.4%
frac-times97.5%
Applied egg-rr97.5%
*-rgt-identity97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -1e-290)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 5e-316) (not (<= (* V l) INFINITY)))
(* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
(/ c0 (/ (sqrt (* V l)) (sqrt A)))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -1e-290) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 5e-316) || !((V * l) <= ((double) INFINITY))) {
tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -1e-290) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 5e-316) || !((V * l) <= Double.POSITIVE_INFINITY)) {
tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -1e-290) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 5e-316) || !(Float64(V * l) <= Inf)) tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[Not[LessEqual[N[(V * l), $MachinePrecision], Infinity]], $MachinePrecision]], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 23.7%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-/l*0.0%
Simplified0.0%
sqrt-undiv23.7%
associate-*l/55.8%
associate-/r/55.7%
associate-/r/55.8%
sqrt-prod52.5%
Applied egg-rr52.5%
if -inf.0 < (*.f64 V l) < -1.0000000000000001e-290Initial program 83.7%
frac-2neg83.7%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -1.0000000000000001e-290 < (*.f64 V l) < 5.000000017e-316 or +inf.0 < (*.f64 V l) Initial program 24.4%
pow1/224.4%
add-cube-cbrt24.3%
pow324.3%
pow-pow24.3%
metadata-eval24.3%
Applied egg-rr24.3%
associate-/r*54.9%
un-div-inv54.8%
cbrt-prod84.1%
cbrt-div83.8%
metadata-eval83.8%
Applied egg-rr83.8%
associate-*r/83.8%
*-rgt-identity83.8%
Simplified83.8%
if 5.000000017e-316 < (*.f64 V l) < +inf.0Initial program 76.8%
sqrt-div88.3%
associate-*r/86.6%
Applied egg-rr86.6%
associate-/l*88.4%
Simplified88.4%
Final simplification88.9%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -1e-290)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-316)
(* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
(if (<= (* V l) INFINITY)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (pow (/ (cbrt (/ A l)) (cbrt V)) 1.5)))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -1e-290) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * pow((cbrt((A / l)) / cbrt(V)), 1.5);
}
return tmp;
}
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -1e-290) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.pow((Math.cbrt((A / l)) / Math.cbrt(V)), 1.5);
}
return tmp;
}
function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -1e-290) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-316) tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5)); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * (Float64(cbrt(Float64(A / l)) / cbrt(V)) ^ 1.5)); end return tmp end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[Power[N[(A / l), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 23.7%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-/l*0.0%
Simplified0.0%
sqrt-undiv23.7%
associate-*l/55.8%
associate-/r/55.7%
associate-/r/55.8%
sqrt-prod52.5%
Applied egg-rr52.5%
if -inf.0 < (*.f64 V l) < -1.0000000000000001e-290Initial program 83.7%
frac-2neg83.7%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -1.0000000000000001e-290 < (*.f64 V l) < 5.000000017e-316Initial program 24.4%
pow1/224.4%
add-cube-cbrt24.3%
pow324.3%
pow-pow24.3%
metadata-eval24.3%
Applied egg-rr24.3%
associate-/r*54.9%
un-div-inv54.8%
cbrt-prod84.1%
cbrt-div83.8%
metadata-eval83.8%
Applied egg-rr83.8%
associate-*r/83.8%
*-rgt-identity83.8%
Simplified83.8%
if 5.000000017e-316 < (*.f64 V l) < +inf.0Initial program 76.8%
sqrt-div88.3%
associate-*r/86.6%
Applied egg-rr86.6%
associate-/l*88.4%
Simplified88.4%
if +inf.0 < (*.f64 V l) Initial program 68.5%
pow1/268.5%
add-cube-cbrt68.0%
pow368.0%
pow-pow68.0%
metadata-eval68.0%
Applied egg-rr68.0%
associate-/r*70.1%
un-div-inv70.1%
associate-*l/66.1%
div-inv66.1%
cbrt-div79.9%
Applied egg-rr79.9%
Final simplification88.9%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -1e-295)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (sqrt (/ A V)) (* c0 (pow l -0.5)))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -1e-295) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt((A / V)) * (c0 * pow(l, -0.5));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -1e-295) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt((A / V)) * (c0 * Math.pow(l, -0.5));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= -1e-295: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt((A / V)) * (c0 * math.pow(l, -0.5)) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -1e-295) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 * (l ^ -0.5))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if ((V * l) <= -Inf) tmp = c0 / (sqrt((V / A)) * sqrt(l)); elseif ((V * l) <= -1e-295) tmp = c0 * (sqrt(-A) / sqrt((V * -l))); elseif ((V * l) <= 0.0) tmp = sqrt((A / V)) * (c0 * (l ^ -0.5)); else tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \left(c0 \cdot {\ell}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 23.7%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-/l*0.0%
Simplified0.0%
sqrt-undiv23.7%
associate-*l/55.8%
associate-/r/55.7%
associate-/r/55.8%
sqrt-prod52.5%
Applied egg-rr52.5%
if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295Initial program 83.9%
frac-2neg83.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -1.00000000000000006e-295 < (*.f64 V l) < 0.0Initial program 20.6%
sqrt-div15.5%
associate-*r/15.5%
Applied egg-rr15.5%
associate-/l*15.5%
Simplified15.5%
div-inv15.5%
clear-num15.5%
sqrt-div20.6%
associate-/r*52.3%
un-div-inv52.3%
*-commutative52.3%
sqrt-prod56.9%
associate-*l*53.8%
inv-pow53.8%
sqrt-pow153.8%
metadata-eval53.8%
Applied egg-rr53.8%
if 0.0 < (*.f64 V l) Initial program 76.7%
pow1/276.7%
clear-num76.1%
inv-pow76.1%
pow-pow76.6%
associate-/l*67.5%
metadata-eval67.5%
Applied egg-rr67.5%
associate-/l*76.6%
*-lft-identity76.6%
times-frac67.8%
/-rgt-identity67.8%
Simplified67.8%
add-sqr-sqrt67.5%
sqrt-unprod67.8%
pow-prod-up67.8%
metadata-eval67.8%
inv-pow67.8%
associate-*r/76.1%
clear-num76.7%
div-inv76.2%
sqrt-prod87.5%
Applied egg-rr87.5%
associate-/r*88.2%
Simplified88.2%
Final simplification85.4%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+307)))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+307))) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+307): tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * math.sqrt(t_0) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if ((t_0 <= 0.0) || ~((t_0 <= 5e+307))) tmp = c0 * (sqrt((A / V)) / sqrt(l)); else tmp = c0 * sqrt(t_0); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+307]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5e307 < (/.f64 A (*.f64 V l)) Initial program 27.5%
associate-/r*45.7%
sqrt-div41.7%
Applied egg-rr41.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 5e307Initial program 98.8%
Final simplification74.5%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+307)))
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+307))) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+307): tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) else: tmp = c0 * math.sqrt(t_0) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if ((t_0 <= 0.0) || ~((t_0 <= 5e+307))) tmp = sqrt((A / V)) * (c0 / sqrt(l)); else tmp = c0 * sqrt(t_0); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+307]], $MachinePrecision]], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5e307 < (/.f64 A (*.f64 V l)) Initial program 27.5%
associate-/r*45.7%
div-inv45.8%
Applied egg-rr45.8%
pow1/245.8%
metadata-eval45.8%
pow-pow44.1%
un-div-inv44.1%
associate-/r*27.5%
pow1/327.5%
Applied egg-rr27.5%
associate-/r*45.6%
Simplified45.6%
cbrt-div77.4%
div-inv77.3%
cbrt-div96.3%
frac-times96.5%
Applied egg-rr96.5%
*-rgt-identity96.5%
Simplified96.5%
add-sqr-sqrt96.4%
sqrt-unprod45.5%
pow-prod-up45.5%
cbrt-unprod27.5%
cbrt-undiv27.5%
*-un-lft-identity27.5%
*-commutative27.5%
frac-times45.6%
associate-/r/44.9%
metadata-eval44.9%
pow344.9%
add-cube-cbrt45.1%
sqrt-div46.2%
metadata-eval46.2%
frac-2neg46.2%
Applied egg-rr40.9%
*-commutative40.9%
associate-*r/40.9%
Simplified40.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 5e307Initial program 98.8%
Final simplification74.2%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(if (<= t_0 5e+307)
(* c0 (sqrt t_0))
(/ c0 (* (sqrt (/ V A)) (sqrt l)))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else if (t_0 <= 5e+307) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else if (t_0 <= 5d+307) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / (sqrt((v / a)) * sqrt(l))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else if (t_0 <= 5e+307) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) elif t_0 <= 5e+307: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); elseif (t_0 <= 5e+307) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 0.0) tmp = sqrt((A / V)) * (c0 / sqrt(l)); elseif (t_0 <= 5e+307) tmp = c0 * sqrt(t_0); else tmp = c0 / (sqrt((V / A)) * sqrt(l)); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+307], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.0%
associate-/r*47.7%
div-inv47.7%
Applied egg-rr47.7%
pow1/247.7%
metadata-eval47.7%
pow-pow46.3%
un-div-inv46.3%
associate-/r*31.0%
pow1/331.0%
Applied egg-rr31.0%
associate-/r*47.6%
Simplified47.6%
cbrt-div81.0%
div-inv80.9%
cbrt-div94.7%
frac-times94.9%
Applied egg-rr94.9%
*-rgt-identity94.9%
Simplified94.9%
add-sqr-sqrt94.9%
sqrt-unprod47.5%
pow-prod-up47.5%
cbrt-unprod31.0%
cbrt-undiv31.0%
*-un-lft-identity31.0%
*-commutative31.0%
frac-times47.6%
associate-/r/46.3%
metadata-eval46.3%
pow346.3%
add-cube-cbrt46.5%
sqrt-div46.5%
metadata-eval46.5%
frac-2neg46.5%
Applied egg-rr37.6%
*-commutative37.6%
associate-*r/39.2%
Simplified39.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 5e307Initial program 98.8%
if 5e307 < (/.f64 A (*.f64 V l)) Initial program 22.9%
sqrt-div22.6%
associate-*r/22.6%
Applied egg-rr22.6%
associate-/l*22.6%
Simplified22.6%
sqrt-undiv25.6%
associate-*l/45.9%
associate-/r/43.1%
associate-/r/45.9%
sqrt-prod46.8%
Applied egg-rr46.8%
Final simplification74.8%
(FPCore (c0 A V l) :precision binary64 (if (<= l -2e-310) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))) (/ c0 (* (sqrt (/ V A)) (sqrt l)))))
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-2d-310)) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
else
tmp = c0 / (sqrt((v / a)) * sqrt(l))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if l <= -2e-310: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) else: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) return tmp
function code(c0, A, V, l) tmp = 0.0 if (l <= -2e-310) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if (l <= -2e-310) tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l))); else tmp = c0 / (sqrt((V / A)) * sqrt(l)); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 70.3%
pow1/270.3%
clear-num69.8%
inv-pow69.8%
pow-pow70.4%
associate-/l*64.9%
metadata-eval64.9%
Applied egg-rr64.9%
associate-/l*70.4%
*-lft-identity70.4%
times-frac66.8%
/-rgt-identity66.8%
Simplified66.8%
add-sqr-sqrt66.5%
sqrt-unprod66.1%
pow-prod-up66.1%
metadata-eval66.1%
inv-pow66.1%
associate-*r/69.8%
clear-num70.3%
div-inv69.8%
sqrt-prod39.6%
Applied egg-rr39.6%
associate-/r*40.3%
Simplified40.3%
if -1.999999999999994e-310 < l Initial program 66.6%
sqrt-div39.2%
associate-*r/38.5%
Applied egg-rr38.5%
associate-/l*39.3%
Simplified39.3%
sqrt-undiv66.6%
associate-*l/70.3%
associate-/r/66.8%
associate-/r/70.3%
sqrt-prod83.0%
Applied egg-rr83.0%
Final simplification61.7%
(FPCore (c0 A V l) :precision binary64 (if (<= l -2e-310) (/ c0 (/ (sqrt (* V l)) (sqrt A))) (/ c0 (* (sqrt (/ V A)) (sqrt l)))))
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-2d-310)) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 / (sqrt((v / a)) * sqrt(l))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if l <= -2e-310: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) return tmp
function code(c0, A, V, l) tmp = 0.0 if (l <= -2e-310) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if (l <= -2e-310) tmp = c0 / (sqrt((V * l)) / sqrt(A)); else tmp = c0 / (sqrt((V / A)) * sqrt(l)); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 70.3%
sqrt-div40.1%
associate-*r/39.4%
Applied egg-rr39.4%
associate-/l*40.1%
Simplified40.1%
if -1.999999999999994e-310 < l Initial program 66.6%
sqrt-div39.2%
associate-*r/38.5%
Applied egg-rr38.5%
associate-/l*39.3%
Simplified39.3%
sqrt-undiv66.6%
associate-*l/70.3%
associate-/r/66.8%
associate-/r/70.3%
sqrt-prod83.0%
Applied egg-rr83.0%
Final simplification61.6%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+297) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+297) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+297) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+297) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+297: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+297) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 0.0) tmp = c0 * sqrt(((A / V) / l)); elseif (t_0 <= 5e+297) tmp = c0 * sqrt(t_0); else tmp = c0 * ((V * (l / A)) ^ -0.5); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+297], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.0%
pow1/231.0%
clear-num31.0%
inv-pow31.0%
pow-pow31.0%
associate-/l*46.5%
metadata-eval46.5%
Applied egg-rr46.5%
associate-/l*31.0%
*-lft-identity31.0%
times-frac46.5%
/-rgt-identity46.5%
Simplified46.5%
Taylor expanded in c0 around 0 31.0%
associate-/r*47.7%
Simplified47.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297Initial program 98.8%
if 4.9999999999999998e297 < (/.f64 A (*.f64 V l)) Initial program 24.5%
pow1/224.5%
clear-num24.5%
inv-pow24.5%
pow-pow27.2%
associate-/l*44.3%
metadata-eval44.3%
Applied egg-rr44.3%
associate-/l*27.2%
*-lft-identity27.2%
times-frac46.0%
/-rgt-identity46.0%
Simplified46.0%
Final simplification76.5%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(sqrt (* (/ c0 V) (* A (/ c0 l))))
(if (<= t_0 5e+297) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt(((c0 / V) * (A * (c0 / l))));
} else if (t_0 <= 5e+297) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = sqrt(((c0 / v) * (a * (c0 / l))))
else if (t_0 <= 5d+297) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt(((c0 / V) * (A * (c0 / l))));
} else if (t_0 <= 5e+297) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt(((c0 / V) * (A * (c0 / l)))) elif t_0 <= 5e+297: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(Float64(c0 / V) * Float64(A * Float64(c0 / l)))); elseif (t_0 <= 5e+297) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 0.0) tmp = sqrt(((c0 / V) * (A * (c0 / l)))); elseif (t_0 <= 5e+297) tmp = c0 * sqrt(t_0); else tmp = c0 * ((V * (l / A)) ^ -0.5); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(A * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+297], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \left(A \cdot \frac{c0}{\ell}\right)}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.0%
associate-/r*47.7%
div-inv47.7%
Applied egg-rr47.7%
pow1/247.7%
metadata-eval47.7%
pow-pow46.3%
un-div-inv46.3%
associate-/r*31.0%
pow1/331.0%
Applied egg-rr31.0%
associate-/r*47.6%
Simplified47.6%
cbrt-div81.0%
div-inv80.9%
cbrt-div94.7%
frac-times94.9%
Applied egg-rr94.9%
*-rgt-identity94.9%
Simplified94.9%
add-sqr-sqrt94.9%
sqrt-unprod47.5%
pow-prod-up47.5%
cbrt-unprod31.0%
cbrt-undiv31.0%
*-un-lft-identity31.0%
*-commutative31.0%
frac-times47.6%
associate-/r/46.3%
metadata-eval46.3%
pow346.3%
add-cube-cbrt46.5%
Applied egg-rr31.8%
times-frac44.8%
associate-/r/49.3%
Simplified49.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297Initial program 98.8%
if 4.9999999999999998e297 < (/.f64 A (*.f64 V l)) Initial program 24.5%
pow1/224.5%
clear-num24.5%
inv-pow24.5%
pow-pow27.2%
associate-/l*44.3%
metadata-eval44.3%
Applied egg-rr44.3%
associate-/l*27.2%
*-lft-identity27.2%
times-frac46.0%
/-rgt-identity46.0%
Simplified46.0%
Final simplification76.9%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+307)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+307))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+307): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if ((t_0 <= 0.0) || ~((t_0 <= 5e+307))) tmp = c0 * sqrt(((A / V) / l)); else tmp = c0 * sqrt(t_0); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+307]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5e307 < (/.f64 A (*.f64 V l)) Initial program 27.5%
pow1/227.5%
clear-num27.5%
inv-pow27.5%
pow-pow28.7%
associate-/l*45.1%
metadata-eval45.1%
Applied egg-rr45.1%
associate-/l*28.7%
*-lft-identity28.7%
times-frac45.8%
/-rgt-identity45.8%
Simplified45.8%
Taylor expanded in c0 around 0 27.5%
associate-/r*45.7%
Simplified45.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 5e307Initial program 98.8%
Final simplification76.2%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+297) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+297) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+297) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+297) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+297: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+297) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 0.0) tmp = c0 * sqrt(((A / V) / l)); elseif (t_0 <= 5e+297) tmp = c0 * sqrt(t_0); else tmp = c0 / sqrt((V * (l / A))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+297], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.0%
pow1/231.0%
clear-num31.0%
inv-pow31.0%
pow-pow31.0%
associate-/l*46.5%
metadata-eval46.5%
Applied egg-rr46.5%
associate-/l*31.0%
*-lft-identity31.0%
times-frac46.5%
/-rgt-identity46.5%
Simplified46.5%
Taylor expanded in c0 around 0 31.0%
associate-/r*47.7%
Simplified47.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297Initial program 98.8%
if 4.9999999999999998e297 < (/.f64 A (*.f64 V l)) Initial program 24.5%
pow1/224.5%
clear-num24.5%
inv-pow24.5%
pow-pow27.2%
associate-/l*44.3%
metadata-eval44.3%
Applied egg-rr44.3%
associate-/l*27.2%
*-lft-identity27.2%
times-frac46.0%
/-rgt-identity46.0%
Simplified46.0%
add-sqr-sqrt46.0%
sqrt-unprod44.4%
pow-prod-up44.4%
metadata-eval44.4%
inv-pow44.4%
sqrt-div46.0%
metadata-eval46.0%
associate-*r/27.1%
sqrt-undiv22.1%
div-inv22.1%
sqrt-undiv27.2%
associate-*r/46.0%
Applied egg-rr46.0%
Final simplification76.5%
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 68.5%
Final simplification68.5%
herbie shell --seed 2023240
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))