
(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 10 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
(let* ((t_0 (sqrt (- A))) (t_1 (/ (/ A V) l)))
(if (<= (* V l) (- INFINITY))
(/ (/ c0 (sqrt l)) (/ (sqrt (- V)) t_0))
(if (<= (* V l) -1e-315)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 4e-283)
(/ c0 (pow t_1 -0.5))
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt t_1))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(-A);
double t_1 = (A / V) / l;
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 / sqrt(l)) / (sqrt(-V) / t_0);
} else if ((V * l) <= -1e-315) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 4e-283) {
tmp = c0 / pow(t_1, -0.5);
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(t_1);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt(-A);
double t_1 = (A / V) / l;
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / Math.sqrt(l)) / (Math.sqrt(-V) / t_0);
} else if ((V * l) <= -1e-315) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 4e-283) {
tmp = c0 / Math.pow(t_1, -0.5);
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(t_1);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt(-A) t_1 = (A / V) / l tmp = 0 if (V * l) <= -math.inf: tmp = (c0 / math.sqrt(l)) / (math.sqrt(-V) / t_0) elif (V * l) <= -1e-315: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 4e-283: tmp = c0 / math.pow(t_1, -0.5) elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(t_1) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-A)) t_1 = Float64(Float64(A / V) / l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 / sqrt(l)) / Float64(sqrt(Float64(-V)) / t_0)); elseif (Float64(V * l) <= -1e-315) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 4e-283) tmp = Float64(c0 / (t_1 ^ -0.5)); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(t_1)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt(-A);
t_1 = (A / V) / l;
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 / sqrt(l)) / (sqrt(-V) / t_0);
elseif ((V * l) <= -1e-315)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 4e-283)
tmp = c0 / (t_1 ^ -0.5);
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(t_1);
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[Sqrt[(-A)], $MachinePrecision]}, Block[{t$95$1 = N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-315], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-283], N[(c0 / N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-A}\\
t_1 := \frac{\frac{A}{V}}{\ell}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\frac{\sqrt{-V}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-283}:\\
\;\;\;\;\frac{c0}{{t\_1}^{-0.5}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_1}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 49.8%
associate-/r*74.1%
clear-num68.9%
sqrt-div68.9%
metadata-eval68.9%
div-inv68.9%
clear-num69.0%
Applied egg-rr69.0%
un-div-inv69.0%
sqrt-prod40.6%
associate-/r*40.6%
Applied egg-rr40.6%
frac-2neg40.6%
sqrt-div46.6%
Applied egg-rr46.6%
if -inf.0 < (*.f64 V l) < -9.999999985e-316Initial program 91.9%
frac-2neg91.9%
sqrt-div99.1%
distribute-rgt-neg-in99.1%
Applied egg-rr99.1%
if -9.999999985e-316 < (*.f64 V l) < 3.99999999999999979e-283Initial program 45.7%
associate-/r*66.8%
clear-num66.8%
sqrt-div66.8%
metadata-eval66.8%
div-inv66.8%
clear-num66.8%
Applied egg-rr66.8%
metadata-eval66.8%
sqrt-div66.9%
associate-*r/45.7%
*-commutative45.7%
clear-num45.7%
frac-2neg45.7%
distribute-rgt-neg-out45.7%
sqrt-undiv10.9%
clear-num10.9%
un-div-inv10.9%
sqrt-undiv45.7%
distribute-rgt-neg-out45.7%
frac-2neg45.7%
associate-/l*67.0%
Applied egg-rr67.0%
associate-*r/45.7%
*-commutative45.7%
associate-/l*67.0%
Simplified67.0%
/-rgt-identity67.0%
clear-num66.9%
metadata-eval66.9%
sqrt-div66.9%
associate-*r/45.7%
*-commutative45.7%
clear-num45.7%
*-commutative45.7%
Applied egg-rr45.7%
*-commutative45.7%
associate-/r*66.9%
Simplified66.9%
pow1/266.9%
pow-flip67.0%
associate-/l/45.7%
*-commutative45.7%
metadata-eval45.7%
Applied egg-rr45.7%
associate-/r*67.0%
Simplified67.0%
if 3.99999999999999979e-283 < (*.f64 V l) < 5e307Initial program 80.9%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 5e307 < (*.f64 V l) Initial program 32.3%
associate-/r*73.5%
Simplified73.5%
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 l))))))
(if (or (<= t_0 5e-299) (not (<= t_0 2e+279)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 5e-299) || !(t_0 <= 2e+279)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = 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 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 5d-299) .or. (.not. (t_0 <= 2d+279))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = 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 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 5e-299) || !(t_0 <= 2e+279)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 5e-299) or not (t_0 <= 2e+279): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 5e-299) || !(t_0 <= 2e+279)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = 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 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 5e-299) || ~((t_0 <= 2e+279)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-299], N[Not[LessEqual[t$95$0, 2e+279]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-299} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+279}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999956e-299 or 2.00000000000000012e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 68.3%
associate-/r*71.8%
Simplified71.8%
if 4.99999999999999956e-299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000012e279Initial program 98.1%
Final simplification78.6%
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 l))))))
(if (<= t_0 5e-299)
(/ c0 (pow (/ (/ A V) l) -0.5))
(if (<= t_0 2e+279) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-299) {
tmp = c0 / pow(((A / V) / l), -0.5);
} else if (t_0 <= 2e+279) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
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 * l)))
if (t_0 <= 5d-299) then
tmp = c0 / (((a / v) / l) ** (-0.5d0))
else if (t_0 <= 2d+279) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
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 * l)));
double tmp;
if (t_0 <= 5e-299) {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
} else if (t_0 <= 2e+279) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-299: tmp = c0 / math.pow(((A / V) / l), -0.5) elif t_0 <= 2e+279: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-299) tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); elseif (t_0 <= 2e+279) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); 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 * l)));
tmp = 0.0;
if (t_0 <= 5e-299)
tmp = c0 / (((A / V) / l) ^ -0.5);
elseif (t_0 <= 2e+279)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-299], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+279], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-299}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+279}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999956e-299Initial program 70.1%
associate-/r*71.9%
clear-num71.1%
sqrt-div71.1%
metadata-eval71.1%
div-inv71.1%
clear-num72.0%
Applied egg-rr72.0%
metadata-eval72.0%
sqrt-div71.7%
associate-*r/70.1%
*-commutative70.1%
clear-num70.1%
frac-2neg70.1%
distribute-rgt-neg-out70.1%
sqrt-undiv37.5%
clear-num37.5%
un-div-inv37.5%
sqrt-undiv70.5%
distribute-rgt-neg-out70.5%
frac-2neg70.5%
associate-/l*74.1%
Applied egg-rr74.1%
associate-*r/70.5%
*-commutative70.5%
associate-/l*72.0%
Simplified72.0%
/-rgt-identity72.0%
clear-num71.9%
metadata-eval71.9%
sqrt-div71.6%
associate-*r/70.0%
*-commutative70.0%
clear-num70.0%
*-commutative70.0%
Applied egg-rr70.0%
*-commutative70.0%
associate-/r*71.8%
Simplified71.8%
pow1/271.8%
pow-flip71.9%
associate-/l/70.0%
*-commutative70.0%
metadata-eval70.0%
Applied egg-rr70.0%
associate-/r*71.9%
Simplified71.9%
if 4.99999999999999956e-299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000012e279Initial program 98.1%
if 2.00000000000000012e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 58.5%
associate-/r*71.4%
clear-num71.4%
sqrt-div71.4%
metadata-eval71.4%
div-inv71.4%
clear-num71.4%
Applied egg-rr71.4%
metadata-eval71.4%
sqrt-div71.5%
associate-*r/58.5%
*-commutative58.5%
clear-num58.5%
frac-2neg58.5%
distribute-rgt-neg-out58.5%
sqrt-undiv33.5%
clear-num33.4%
un-div-inv33.5%
sqrt-undiv58.5%
distribute-rgt-neg-out58.5%
frac-2neg58.5%
associate-/l*71.5%
Applied egg-rr71.5%
associate-*r/58.5%
*-commutative58.5%
associate-/l*71.5%
Simplified71.5%
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 l))))))
(if (<= t_0 5e-299)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+279) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-299) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+279) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
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 * l)))
if (t_0 <= 5d-299) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+279) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
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 * l)));
double tmp;
if (t_0 <= 5e-299) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+279) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-299: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+279: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-299) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+279) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); 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 * l)));
tmp = 0.0;
if (t_0 <= 5e-299)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+279)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-299], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+279], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-299}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+279}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999956e-299Initial program 70.1%
associate-/r*71.9%
Simplified71.9%
if 4.99999999999999956e-299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000012e279Initial program 98.1%
if 2.00000000000000012e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 58.5%
associate-/r*71.4%
clear-num71.4%
sqrt-div71.4%
metadata-eval71.4%
div-inv71.4%
clear-num71.4%
Applied egg-rr71.4%
metadata-eval71.4%
sqrt-div71.5%
associate-*r/58.5%
*-commutative58.5%
clear-num58.5%
frac-2neg58.5%
distribute-rgt-neg-out58.5%
sqrt-undiv33.5%
clear-num33.4%
un-div-inv33.5%
sqrt-undiv58.5%
distribute-rgt-neg-out58.5%
frac-2neg58.5%
associate-/l*71.5%
Applied egg-rr71.5%
associate-*r/58.5%
*-commutative58.5%
associate-/l*71.5%
Simplified71.5%
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 l))))))
(if (<= t_0 5e-299)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+299) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-299) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+299) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
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 * l)))
if (t_0 <= 5d-299) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+299) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
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 * l)));
double tmp;
if (t_0 <= 5e-299) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+299) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-299: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+299: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-299) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+299) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 * l)));
tmp = 0.0;
if (t_0 <= 5e-299)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+299)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-299], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+299], t$95$0, 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])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-299}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+299}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999956e-299Initial program 70.1%
associate-/r*71.9%
Simplified71.9%
if 4.99999999999999956e-299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e299Initial program 98.1%
if 1.0000000000000001e299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 58.5%
associate-/r*71.4%
clear-num71.4%
sqrt-div71.4%
metadata-eval71.4%
div-inv71.4%
clear-num71.4%
Applied egg-rr71.4%
metadata-eval71.4%
sqrt-div71.5%
associate-*r/58.5%
*-commutative58.5%
clear-num58.5%
frac-2neg58.5%
distribute-rgt-neg-out58.5%
sqrt-undiv33.5%
clear-num33.4%
un-div-inv33.5%
sqrt-undiv58.5%
distribute-rgt-neg-out58.5%
frac-2neg58.5%
associate-/l*71.5%
Applied egg-rr71.5%
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 (<= (* V l) -1e+78)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-315)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 4e-283)
(/ c0 (pow t_0 -0.5))
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* 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 ((V * l) <= -1e+78) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-315) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 4e-283) {
tmp = c0 / pow(t_0, -0.5);
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((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 ((v * l) <= (-1d+78)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-315)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 4d-283) then
tmp = c0 / (t_0 ** (-0.5d0))
else if ((v * l) <= 5d+307) then
tmp = c0 * (sqrt(a) / sqrt((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 ((V * l) <= -1e+78) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-315) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 4e-283) {
tmp = c0 / Math.pow(t_0, -0.5);
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 (V * l) <= -1e+78: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-315: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 4e-283: tmp = c0 / math.pow(t_0, -0.5) elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((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(Float64(A / V) / l) tmp = 0.0 if (Float64(V * l) <= -1e+78) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-315) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 4e-283) tmp = Float64(c0 / (t_0 ^ -0.5)); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 ((V * l) <= -1e+78)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-315)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 4e-283)
tmp = c0 / (t_0 ^ -0.5);
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((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[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+78], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-315], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-283], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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{\frac{A}{V}}{\ell}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+78}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-283}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000001e78Initial program 83.5%
associate-/r*83.0%
sqrt-div60.3%
div-inv60.2%
Applied egg-rr60.2%
associate-*r/60.3%
*-rgt-identity60.3%
Simplified60.3%
if -1.00000000000000001e78 < (*.f64 V l) < -9.999999985e-316Initial program 88.5%
frac-2neg88.5%
sqrt-div98.9%
distribute-rgt-neg-in98.9%
Applied egg-rr98.9%
if -9.999999985e-316 < (*.f64 V l) < 3.99999999999999979e-283Initial program 45.7%
associate-/r*66.8%
clear-num66.8%
sqrt-div66.8%
metadata-eval66.8%
div-inv66.8%
clear-num66.8%
Applied egg-rr66.8%
metadata-eval66.8%
sqrt-div66.9%
associate-*r/45.7%
*-commutative45.7%
clear-num45.7%
frac-2neg45.7%
distribute-rgt-neg-out45.7%
sqrt-undiv10.9%
clear-num10.9%
un-div-inv10.9%
sqrt-undiv45.7%
distribute-rgt-neg-out45.7%
frac-2neg45.7%
associate-/l*67.0%
Applied egg-rr67.0%
associate-*r/45.7%
*-commutative45.7%
associate-/l*67.0%
Simplified67.0%
/-rgt-identity67.0%
clear-num66.9%
metadata-eval66.9%
sqrt-div66.9%
associate-*r/45.7%
*-commutative45.7%
clear-num45.7%
*-commutative45.7%
Applied egg-rr45.7%
*-commutative45.7%
associate-/r*66.9%
Simplified66.9%
pow1/266.9%
pow-flip67.0%
associate-/l/45.7%
*-commutative45.7%
metadata-eval45.7%
Applied egg-rr45.7%
associate-/r*67.0%
Simplified67.0%
if 3.99999999999999979e-283 < (*.f64 V l) < 5e307Initial program 80.9%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 5e307 < (*.f64 V l) Initial program 32.3%
associate-/r*73.5%
Simplified73.5%
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) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / 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) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+307) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / 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) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / 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) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / 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], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $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 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 77.3%
associate-/r*76.4%
clear-num75.8%
sqrt-div75.7%
metadata-eval75.7%
div-inv75.7%
clear-num76.8%
Applied egg-rr76.8%
un-div-inv76.9%
sqrt-prod48.0%
associate-/r*45.9%
Applied egg-rr45.9%
associate-/r*48.0%
Simplified48.0%
if 0.0 < (*.f64 V l) < 5e307Initial program 81.3%
sqrt-div99.1%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/99.1%
*-rgt-identity99.1%
Simplified99.1%
if 5e307 < (*.f64 V l) Initial program 32.3%
associate-/r*73.5%
Simplified73.5%
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) 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / 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) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d+307) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / 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) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / 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) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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) <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / 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], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $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 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 77.3%
associate-/r*76.4%
sqrt-div47.1%
div-inv47.1%
Applied egg-rr47.1%
associate-*r/47.1%
*-rgt-identity47.1%
Simplified47.1%
if 0.0 < (*.f64 V l) < 5e307Initial program 81.3%
sqrt-div99.1%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/99.1%
*-rgt-identity99.1%
Simplified99.1%
if 5e307 < (*.f64 V l) Initial program 32.3%
associate-/r*73.5%
Simplified73.5%
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) 4e-283)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 4e-283) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / 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) <= 4d-283) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 5d+307) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / 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) <= 4e-283) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 4e-283: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / 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) <= 4e-283) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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) <= 4e-283)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / 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], 4e-283], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $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 4 \cdot 10^{-283}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 3.99999999999999979e-283Initial program 77.7%
associate-/r*77.0%
clear-num76.4%
sqrt-div76.4%
metadata-eval76.4%
div-inv76.4%
clear-num77.4%
Applied egg-rr77.4%
metadata-eval77.4%
sqrt-div77.1%
associate-*r/77.6%
*-commutative77.6%
clear-num77.7%
frac-2neg77.7%
distribute-rgt-neg-out77.7%
sqrt-undiv75.4%
clear-num75.3%
un-div-inv75.4%
sqrt-undiv78.2%
distribute-rgt-neg-out78.2%
frac-2neg78.2%
associate-/l*78.9%
Applied egg-rr78.9%
associate-*r/78.2%
*-commutative78.2%
associate-/l*77.5%
Simplified77.5%
if 3.99999999999999979e-283 < (*.f64 V l) < 5e307Initial program 80.9%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 5e307 < (*.f64 V l) Initial program 32.3%
associate-/r*73.5%
Simplified73.5%
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 75.9%
herbie shell --seed 2024114
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))