?

Average Error: 70.9% → 91.3%
Time: 25.4s
Precision: binary64
Cost: 20036.00

?

\[ \begin{array}{c}[V, l] = \mathsf{sort}([V, l])\\ \end{array} \]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := \sqrt{-V}\\ t_1 := \sqrt{-A}\\ \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{\frac{t_1 \cdot c0}{t_0}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-302}:\\ \;\;\;\;c0 \cdot \frac{t_1}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (sqrt (- V))) (t_1 (sqrt (- A))))
   (if (<= (* V l) (- INFINITY))
     (/ (/ (* t_1 c0) t_0) (sqrt l))
     (if (<= (* V l) -2e-302)
       (* c0 (/ t_1 (sqrt (* V (- l)))))
       (if (<= (* V l) 0.0)
         (* c0 (/ (sqrt (/ A (- l))) t_0))
         (/ c0 (/ (sqrt (* V l)) (sqrt A))))))))
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
double code(double c0, double A, double V, double l) {
	double t_0 = sqrt(-V);
	double t_1 = sqrt(-A);
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = ((t_1 * c0) / t_0) / sqrt(l);
	} else if ((V * l) <= -2e-302) {
		tmp = c0 * (t_1 / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (sqrt((A / -l)) / t_0);
	} else {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	}
	return tmp;
}
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
public static double code(double c0, double A, double V, double l) {
	double t_0 = Math.sqrt(-V);
	double t_1 = Math.sqrt(-A);
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = ((t_1 * c0) / t_0) / Math.sqrt(l);
	} else if ((V * l) <= -2e-302) {
		tmp = c0 * (t_1 / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (Math.sqrt((A / -l)) / t_0);
	} else {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	}
	return tmp;
}
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
def code(c0, A, V, l):
	t_0 = math.sqrt(-V)
	t_1 = math.sqrt(-A)
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = ((t_1 * c0) / t_0) / math.sqrt(l)
	elif (V * l) <= -2e-302:
		tmp = c0 * (t_1 / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = c0 * (math.sqrt((A / -l)) / t_0)
	else:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	return tmp
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
function code(c0, A, V, l)
	t_0 = sqrt(Float64(-V))
	t_1 = sqrt(Float64(-A))
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(Float64(t_1 * c0) / t_0) / sqrt(l));
	elseif (Float64(V * l) <= -2e-302)
		tmp = Float64(c0 * Float64(t_1 / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / t_0));
	else
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	end
	return tmp
end
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
function tmp_2 = code(c0, A, V, l)
	t_0 = sqrt(-V);
	t_1 = sqrt(-A);
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = ((t_1 * c0) / t_0) / sqrt(l);
	elseif ((V * l) <= -2e-302)
		tmp = c0 * (t_1 / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = c0 * (sqrt((A / -l)) / t_0);
	else
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-V)], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(N[(t$95$1 * c0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-302], N[(c0 * N[(t$95$1 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := \sqrt{-V}\\
t_1 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{t_1 \cdot c0}{t_0}}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot \frac{t_1}{\sqrt{V \cdot \left(-\ell\right)}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 4 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 35.3

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied egg-rr81.5

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    3. Applied egg-rr93.6

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{-V}}}}{\sqrt{\ell}} \]

    if -inf.0 < (*.f64 V l) < -1.9999999999999999e-302

    1. Initial program 84.0

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied egg-rr95.6

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}} \]
    3. Simplified99.4

      \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}} \cdot c0} \]
      Proof

      [Start]95.6

      \[ \frac{c0 \cdot \sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}} \]

      *-commutative [<=]95.6

      \[ \frac{\color{blue}{\sqrt{-A} \cdot c0}}{\sqrt{V \cdot \left(-\ell\right)}} \]

      associate-/l* [=>]95.7

      \[ \color{blue}{\frac{\sqrt{-A}}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{c0}}} \]

      associate-/r/ [=>]99.4

      \[ \color{blue}{\frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}} \cdot c0} \]

    if -1.9999999999999999e-302 < (*.f64 V l) < -0.0

    1. Initial program 3.7

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied egg-rr43.2

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{\ell} \cdot \frac{1}{V}}} \]
    3. Applied egg-rr43.2

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
    4. Applied egg-rr57.7

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}} \]

    if -0.0 < (*.f64 V l)

    1. Initial program 77.9

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied egg-rr90.6

      \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification91.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{\frac{\sqrt{-A} \cdot c0}{\sqrt{-V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-302}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]

Alternatives

Alternative 1
Error79.1%
Cost34641.00
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;t_0 \leq -1 \cdot 10^{-303} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 5 \cdot 10^{+294}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0}{V} \cdot \frac{c0}{\ell}\right)}\\ \end{array} \]
Alternative 2
Error78.5%
Cost34641.00
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;t_0 \leq -1 \cdot 10^{-303} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 5 \cdot 10^{+294}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{A \cdot c0}{\frac{V}{c0}}}{\ell}}\\ \end{array} \]
Alternative 3
Error78.2%
Cost34641.00
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{+288}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \mathbf{elif}\;t_0 \leq -1 \cdot 10^{-303} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 5 \cdot 10^{+294}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{A \cdot c0}{\frac{V}{c0}}}{\ell}}\\ \end{array} \]
Alternative 4
Error78.5%
Cost34641.00
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0}}\\ \mathbf{elif}\;t_0 \leq -1 \cdot 10^{-303} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 5 \cdot 10^{+294}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{A \cdot c0}{\frac{V}{c0}}}{\ell}}\\ \end{array} \]
Alternative 5
Error80.9%
Cost34640.00
\[\begin{array}{l} t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ t_1 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-265}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+294}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{A \cdot c0}{\frac{V}{c0}}}{\ell}}\\ \end{array} \]
Alternative 6
Error85.9%
Cost14156.00
\[\begin{array}{l} t_0 := c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+209}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-132}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]
Alternative 7
Error89.2%
Cost14156.00
\[\begin{array}{l} t_0 := c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-302}:\\ \;\;\;\;\sqrt{-A} \cdot \frac{c0}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]
Alternative 8
Error90.6%
Cost14156.00
\[\begin{array}{l} t_0 := c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-302}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]
Alternative 9
Error85.6%
Cost14028.00
\[\begin{array}{l} t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+187}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-109}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]
Alternative 10
Error85.4%
Cost14028.00
\[\begin{array}{l} t_0 := \sqrt{\frac{A}{V}}\\ \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+187}:\\ \;\;\;\;{\ell}^{-0.5} \cdot \left(c0 \cdot t_0\right)\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-109}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]
Alternative 11
Error85.3%
Cost14028.00
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+187}:\\ \;\;\;\;\frac{{\ell}^{-0.5}}{\frac{\sqrt{\frac{V}{A}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-109}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]
Alternative 12
Error77.4%
Cost7625.00
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-310} \lor \neg \left(t_0 \leq 10^{+292}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 13
Error78.0%
Cost7625.00
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+306}\right):\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 14
Error78.1%
Cost7624.00
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;t_0 \leq 10^{+306}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \end{array} \]
Alternative 15
Error78.0%
Cost7624.00
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;t_0 \leq 10^{+306}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \]
Alternative 16
Error70.9%
Cost6848.00
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]

Error

Reproduce?

herbie shell --seed 2023093 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))