
(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 13 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}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -2e-273)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-319)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+263)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(* c0 (sqrt (/ (* A (/ 1.0 V)) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -2e-273) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-319) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+263) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -2e-273) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-319) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+263) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -2e-273: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-319: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+263: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -2e-273) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-319) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+263) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -2e-273)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-319)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+263)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-273], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-319], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+263], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-319}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+263}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 48.3%
*-un-lft-identity48.3%
times-frac82.6%
Applied egg-rr82.6%
associate-*l/82.6%
*-un-lft-identity82.6%
Applied egg-rr82.6%
frac-2neg82.6%
sqrt-div45.3%
distribute-neg-frac245.3%
Applied egg-rr45.3%
distribute-frac-neg245.3%
distribute-neg-frac45.3%
Simplified45.3%
if -inf.0 < (*.f64 V l) < -2e-273Initial program 87.8%
frac-2neg87.8%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -2e-273 < (*.f64 V l) < 9.99989e-320Initial program 50.3%
*-un-lft-identity50.3%
times-frac74.6%
Applied egg-rr74.6%
associate-*r/74.6%
sqrt-div54.5%
associate-*l/54.5%
*-un-lft-identity54.5%
clear-num54.3%
un-div-inv54.4%
*-un-lft-identity54.4%
associate-*l/54.4%
sqrt-undiv74.8%
clear-num74.8%
associate-*l/74.7%
*-un-lft-identity74.7%
associate-/r*50.4%
clear-num50.4%
associate-/l*74.8%
Applied egg-rr74.8%
associate-*r/50.4%
associate-*l/74.8%
*-commutative74.8%
Simplified74.8%
if 9.99989e-320 < (*.f64 V l) < 2.00000000000000003e263Initial program 80.1%
*-commutative80.1%
sqrt-div98.6%
associate-*l/98.7%
Applied egg-rr98.7%
if 2.00000000000000003e263 < (*.f64 V l) Initial program 56.4%
associate-/r*77.0%
Simplified77.0%
clear-num77.0%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification90.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -5e-310) (* c0 (/ (sqrt (/ A (- l))) (sqrt (- V)))) (* c0 (/ (/ (sqrt A) (sqrt V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else {
tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 (v <= (-5d-310)) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else
tmp = c0 * ((sqrt(a) / sqrt(v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else {
tmp = c0 * ((Math.sqrt(A) / Math.sqrt(V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) else: tmp = c0 * ((math.sqrt(A) / math.sqrt(V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
else
tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 74.2%
*-un-lft-identity74.2%
times-frac77.1%
Applied egg-rr77.1%
associate-*l/77.1%
*-un-lft-identity77.1%
Applied egg-rr77.1%
frac-2neg77.1%
sqrt-div84.3%
distribute-neg-frac284.3%
Applied egg-rr84.3%
distribute-frac-neg284.3%
distribute-neg-frac84.3%
Simplified84.3%
if -4.999999999999985e-310 < V Initial program 74.8%
associate-/r*79.4%
sqrt-div45.5%
div-inv45.4%
Applied egg-rr45.4%
associate-*r/45.5%
*-rgt-identity45.5%
Simplified45.5%
sqrt-div52.8%
clear-num52.8%
Applied egg-rr52.8%
associate-/r/52.8%
associate-*l/52.8%
*-lft-identity52.8%
Simplified52.8%
Final simplification68.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+257)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) -2e-273)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-319)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+263)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(* c0 (sqrt (/ (* A (/ 1.0 V)) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+257) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= -2e-273) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-319) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+263) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 ((v * l) <= (-2d+257)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= (-2d-273)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 1d-319) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 2d+263) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
else
tmp = c0 * sqrt(((a * (1.0d0 / v)) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+257) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= -2e-273) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-319) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+263) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+257: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= -2e-273: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-319: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+263: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+257) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= -2e-273) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-319) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+263) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+257)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= -2e-273)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-319)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+263)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+257], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-273], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-319], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+263], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+257}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-319}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+263}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000006e257Initial program 61.0%
*-un-lft-identity61.0%
times-frac83.1%
Applied egg-rr83.1%
associate-*r/83.2%
sqrt-div29.8%
associate-*l/29.8%
*-un-lft-identity29.8%
clear-num29.8%
un-div-inv29.8%
*-un-lft-identity29.8%
associate-*l/29.8%
sqrt-undiv83.2%
clear-num83.2%
associate-*l/83.2%
*-un-lft-identity83.2%
associate-/r*61.0%
clear-num61.0%
associate-/l*83.3%
Applied egg-rr83.3%
associate-*r/61.0%
*-commutative61.0%
associate-/l*83.2%
sqrt-unprod29.7%
*-commutative29.7%
Applied egg-rr29.7%
if -2.00000000000000006e257 < (*.f64 V l) < -2e-273Initial program 88.0%
frac-2neg88.0%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -2e-273 < (*.f64 V l) < 9.99989e-320Initial program 50.3%
*-un-lft-identity50.3%
times-frac74.6%
Applied egg-rr74.6%
associate-*r/74.6%
sqrt-div54.5%
associate-*l/54.5%
*-un-lft-identity54.5%
clear-num54.3%
un-div-inv54.4%
*-un-lft-identity54.4%
associate-*l/54.4%
sqrt-undiv74.8%
clear-num74.8%
associate-*l/74.7%
*-un-lft-identity74.7%
associate-/r*50.4%
clear-num50.4%
associate-/l*74.8%
Applied egg-rr74.8%
associate-*r/50.4%
associate-*l/74.8%
*-commutative74.8%
Simplified74.8%
if 9.99989e-320 < (*.f64 V l) < 2.00000000000000003e263Initial program 80.1%
*-commutative80.1%
sqrt-div98.6%
associate-*l/98.7%
Applied egg-rr98.7%
if 2.00000000000000003e263 < (*.f64 V l) Initial program 56.4%
associate-/r*77.0%
Simplified77.0%
clear-num77.0%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification88.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+225)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-88)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0))
(if (<= (* V l) 1e-319)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+263)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(* c0 (sqrt (/ (* A (/ 1.0 V)) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+225) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-88) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-319) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+263) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 ((v * l) <= (-2d+225)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-88)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0)
else if ((v * l) <= 1d-319) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+263) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
else
tmp = c0 * sqrt(((a * (1.0d0 / v)) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+225) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-88) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-319) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+263) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+225: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-88: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0) elif (V * l) <= 1e-319: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+263: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+225) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-88) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0)); elseif (Float64(V * l) <= 1e-319) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+263) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+225)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-88)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
elseif ((V * l) <= 1e-319)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+263)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+225], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-88], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-319], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+263], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+225}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-88}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-319}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+263}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999986e225Initial program 61.1%
associate-/r*78.2%
sqrt-div32.0%
div-inv32.0%
Applied egg-rr32.0%
associate-*r/32.0%
*-rgt-identity32.0%
Simplified32.0%
if -1.99999999999999986e225 < (*.f64 V l) < -9.99999999999999934e-89Initial program 94.9%
*-un-lft-identity94.9%
times-frac85.0%
Applied egg-rr85.0%
associate-*l/85.0%
*-un-lft-identity85.0%
Applied egg-rr85.0%
associate-/l/94.9%
clear-num94.9%
associate-*r/86.4%
sqrt-div87.6%
metadata-eval87.6%
div-inv87.8%
clear-num87.8%
associate-*r/96.2%
Applied egg-rr96.2%
if -9.99999999999999934e-89 < (*.f64 V l) < 9.99989e-320Initial program 60.5%
*-un-lft-identity60.5%
times-frac74.1%
Applied egg-rr74.1%
associate-*r/72.8%
sqrt-div50.4%
associate-*l/50.4%
*-un-lft-identity50.4%
clear-num50.2%
un-div-inv50.3%
*-un-lft-identity50.3%
associate-*l/50.3%
sqrt-undiv72.8%
clear-num72.8%
associate-*l/72.7%
*-un-lft-identity72.7%
associate-/r*60.5%
clear-num60.5%
associate-/l*74.2%
Applied egg-rr74.2%
associate-*r/60.5%
*-commutative60.5%
associate-/l*72.7%
sqrt-unprod51.5%
*-commutative51.5%
Applied egg-rr51.5%
if 9.99989e-320 < (*.f64 V l) < 2.00000000000000003e263Initial program 80.1%
*-commutative80.1%
sqrt-div98.6%
associate-*l/98.7%
Applied egg-rr98.7%
if 2.00000000000000003e263 < (*.f64 V l) Initial program 56.4%
associate-/r*77.0%
Simplified77.0%
clear-num77.0%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification78.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+225)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-88)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0))
(if (<= (* V l) 1e-319)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+263)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (* A (/ 1.0 V)) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+225) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-88) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-319) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+263) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 ((v * l) <= (-2d+225)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-88)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0)
else if ((v * l) <= 1d-319) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+263) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a * (1.0d0 / v)) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+225) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-88) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-319) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+263) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+225: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-88: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0) elif (V * l) <= 1e-319: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+263: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+225) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-88) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0)); elseif (Float64(V * l) <= 1e-319) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+263) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+225)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-88)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
elseif ((V * l) <= 1e-319)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+263)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+225], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-88], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-319], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+263], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+225}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-88}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-319}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999986e225Initial program 61.1%
associate-/r*78.2%
sqrt-div32.0%
div-inv32.0%
Applied egg-rr32.0%
associate-*r/32.0%
*-rgt-identity32.0%
Simplified32.0%
if -1.99999999999999986e225 < (*.f64 V l) < -9.99999999999999934e-89Initial program 94.9%
*-un-lft-identity94.9%
times-frac85.0%
Applied egg-rr85.0%
associate-*l/85.0%
*-un-lft-identity85.0%
Applied egg-rr85.0%
associate-/l/94.9%
clear-num94.9%
associate-*r/86.4%
sqrt-div87.6%
metadata-eval87.6%
div-inv87.8%
clear-num87.8%
associate-*r/96.2%
Applied egg-rr96.2%
if -9.99999999999999934e-89 < (*.f64 V l) < 9.99989e-320Initial program 60.5%
*-un-lft-identity60.5%
times-frac74.1%
Applied egg-rr74.1%
associate-*r/72.8%
sqrt-div50.4%
associate-*l/50.4%
*-un-lft-identity50.4%
clear-num50.2%
un-div-inv50.3%
*-un-lft-identity50.3%
associate-*l/50.3%
sqrt-undiv72.8%
clear-num72.8%
associate-*l/72.7%
*-un-lft-identity72.7%
associate-/r*60.5%
clear-num60.5%
associate-/l*74.2%
Applied egg-rr74.2%
associate-*r/60.5%
*-commutative60.5%
associate-/l*72.7%
sqrt-unprod51.5%
*-commutative51.5%
Applied egg-rr51.5%
if 9.99989e-320 < (*.f64 V l) < 2.00000000000000003e263Initial program 80.1%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000003e263 < (*.f64 V l) Initial program 56.4%
associate-/r*77.0%
Simplified77.0%
clear-num77.0%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification78.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -2e+225)
t_0
(if (<= (* V l) -1e-88)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0))
(if (<= (* V l) 1e-319)
t_0
(if (<= (* V l) 2e+263)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (* A (/ 1.0 V)) l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+225) {
tmp = t_0;
} else if ((V * l) <= -1e-88) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-319) {
tmp = t_0;
} else if ((V * l) <= 2e+263) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-2d+225)) then
tmp = t_0
else if ((v * l) <= (-1d-88)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0)
else if ((v * l) <= 1d-319) then
tmp = t_0
else if ((v * l) <= 2d+263) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a * (1.0d0 / v)) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+225) {
tmp = t_0;
} else if ((V * l) <= -1e-88) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-319) {
tmp = t_0;
} else if ((V * l) <= 2e+263) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+225: tmp = t_0 elif (V * l) <= -1e-88: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0) elif (V * l) <= 1e-319: tmp = t_0 elif (V * l) <= 2e+263: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+225) tmp = t_0; elseif (Float64(V * l) <= -1e-88) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0)); elseif (Float64(V * l) <= 1e-319) tmp = t_0; elseif (Float64(V * l) <= 2e+263) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+225)
tmp = t_0;
elseif ((V * l) <= -1e-88)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
elseif ((V * l) <= 1e-319)
tmp = t_0;
elseif ((V * l) <= 2e+263)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+225], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-88], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-319], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+263], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+225}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-88}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-319}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999986e225 or -9.99999999999999934e-89 < (*.f64 V l) < 9.99989e-320Initial program 60.6%
associate-/r*74.1%
sqrt-div45.8%
div-inv45.7%
Applied egg-rr45.7%
associate-*r/45.8%
*-rgt-identity45.8%
Simplified45.8%
if -1.99999999999999986e225 < (*.f64 V l) < -9.99999999999999934e-89Initial program 94.9%
*-un-lft-identity94.9%
times-frac85.0%
Applied egg-rr85.0%
associate-*l/85.0%
*-un-lft-identity85.0%
Applied egg-rr85.0%
associate-/l/94.9%
clear-num94.9%
associate-*r/86.4%
sqrt-div87.6%
metadata-eval87.6%
div-inv87.8%
clear-num87.8%
associate-*r/96.2%
Applied egg-rr96.2%
if 9.99989e-320 < (*.f64 V l) < 2.00000000000000003e263Initial program 80.1%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000003e263 < (*.f64 V l) Initial program 56.4%
associate-/r*77.0%
Simplified77.0%
clear-num77.0%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification77.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 1e-319)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= (* V l) 2e+263)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (* A (/ 1.0 V)) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 1e-319) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if ((V * l) <= 2e+263) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 ((v * l) <= 1d-319) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else if ((v * l) <= 2d+263) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a * (1.0d0 / v)) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 1e-319) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if ((V * l) <= 2e+263) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 1e-319: tmp = c0 * math.pow((V * (l / A)), -0.5) elif (V * l) <= 2e+263: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 1e-319) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (Float64(V * l) <= 2e+263) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 1e-319)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif ((V * l) <= 2e+263)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 1e-319], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+263], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 10^{-319}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 9.99989e-320Initial program 74.4%
*-un-lft-identity74.4%
times-frac79.1%
Applied egg-rr79.1%
associate-*l/79.1%
*-un-lft-identity79.1%
Applied egg-rr79.1%
associate-/l/74.4%
clear-num74.4%
associate-*r/79.7%
sqrt-div80.1%
metadata-eval80.1%
pow1/280.1%
pow-flip80.3%
associate-*r/75.0%
metadata-eval75.0%
Applied egg-rr75.0%
associate-/l*80.3%
Simplified80.3%
if 9.99989e-320 < (*.f64 V l) < 2.00000000000000003e263Initial program 80.1%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000003e263 < (*.f64 V l) Initial program 56.4%
associate-/r*77.0%
Simplified77.0%
clear-num77.0%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification86.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 8e+271)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
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 <= 8e+271)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 <= 8d+271))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
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 <= 8e+271)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 8e+271): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 8e+271)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 8e+271)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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, 8e+271]], $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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 8 \cdot 10^{+271}\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 7.99999999999999962e271 < (/.f64 A (*.f64 V l)) Initial program 48.8%
associate-/r*62.9%
Simplified62.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 7.99999999999999962e271Initial program 99.0%
Final simplification81.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (/ c0 (sqrt (* V (* l (/ 1.0 A))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 / sqrt((V * (l * (1.0 / A))));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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((v * (l * (1.0d0 / a))))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 / Math.sqrt((V * (l * (1.0 / A))));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 / math.sqrt((V * (l * (1.0 / A))))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 / sqrt(Float64(V * Float64(l * Float64(1.0 / A))))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 / sqrt((V * (l * (1.0 / A))));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 / N[Sqrt[N[(V * N[(l * N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\frac{c0}{\sqrt{V \cdot \left(\ell \cdot \frac{1}{A}\right)}}
\end{array}
Initial program 74.5%
*-un-lft-identity74.5%
times-frac75.9%
Applied egg-rr75.9%
associate-*r/77.9%
sqrt-div45.9%
associate-*l/45.9%
*-un-lft-identity45.9%
clear-num45.8%
un-div-inv45.9%
*-un-lft-identity45.9%
associate-*l/45.9%
sqrt-undiv78.5%
clear-num77.9%
associate-*l/77.9%
*-un-lft-identity77.9%
associate-/r*74.2%
clear-num74.8%
associate-/l*76.3%
Applied egg-rr76.3%
clear-num75.7%
associate-/r/76.3%
Applied egg-rr76.3%
Final simplification76.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (pow (* V (/ l A)) -0.5)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * pow((V * (l / A)), -0.5);
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 * ((v * (l / a)) ** (-0.5d0))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.pow((V * (l / A)), -0.5);
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.pow((V * (l / A)), -0.5)
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}
\end{array}
Initial program 74.5%
*-un-lft-identity74.5%
times-frac75.9%
Applied egg-rr75.9%
associate-*l/75.9%
*-un-lft-identity75.9%
Applied egg-rr75.9%
associate-/l/74.5%
clear-num74.3%
associate-*r/76.0%
sqrt-div76.2%
metadata-eval76.2%
pow1/276.2%
pow-flip76.3%
associate-*r/74.9%
metadata-eval74.9%
Applied egg-rr74.9%
associate-/l*76.3%
Simplified76.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (/ c0 (sqrt (* V (/ l A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 / sqrt((V * (l / A)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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((v * (l / a)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 / Math.sqrt((V * (l / A)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 / math.sqrt((V * (l / A)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 / sqrt(Float64(V * Float64(l / A)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 / sqrt((V * (l / A)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}
\end{array}
Initial program 74.5%
*-un-lft-identity74.5%
times-frac75.9%
Applied egg-rr75.9%
associate-*r/77.9%
sqrt-div45.9%
associate-*l/45.9%
*-un-lft-identity45.9%
clear-num45.8%
un-div-inv45.9%
*-un-lft-identity45.9%
associate-*l/45.9%
sqrt-undiv78.5%
clear-num77.9%
associate-*l/77.9%
*-un-lft-identity77.9%
associate-/r*74.2%
clear-num74.8%
associate-/l*76.3%
Applied egg-rr76.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ (/ A l) V))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt(((A / l) / V));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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 / l) / v))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt(((A / l) / V));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt(((A / l) / V))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(Float64(A / l) / V))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt(((A / l) / V));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}
\end{array}
Initial program 74.5%
*-un-lft-identity74.5%
times-frac75.9%
Applied egg-rr75.9%
associate-*l/75.9%
*-un-lft-identity75.9%
Applied egg-rr75.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 74.5%
herbie shell --seed 2024120
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))