Henrywood and Agarwal, Equation (3)

?

Percentage Accurate: 73.2% → 86.2%
Time: 8.2s
Precision: binary64
Cost: 14028

?

\[ \begin{array}{c}[V, l] = \mathsf{sort}([V, l])\\ \end{array} \]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\left(\sqrt{\frac{A}{V}} \cdot c0\right) \cdot {\ell}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-323}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-320}:\\ \;\;\;\;\sqrt{\frac{A \cdot \frac{c0}{\frac{\ell}{c0}}}{V}}\\ \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
 (if (<= (* V l) (- INFINITY))
   (* (* (sqrt (/ A V)) c0) (pow l -0.5))
   (if (<= (* V l) -2e-323)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 4e-320)
       (sqrt (/ (* A (/ c0 (/ l c0))) V))
       (/ 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 tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (sqrt((A / V)) * c0) * pow(l, -0.5);
	} else if ((V * l) <= -2e-323) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 4e-320) {
		tmp = sqrt(((A * (c0 / (l / c0))) / V));
	} 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 tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (Math.sqrt((A / V)) * c0) * Math.pow(l, -0.5);
	} else if ((V * l) <= -2e-323) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 4e-320) {
		tmp = Math.sqrt(((A * (c0 / (l / c0))) / V));
	} 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):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (math.sqrt((A / V)) * c0) * math.pow(l, -0.5)
	elif (V * l) <= -2e-323:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 4e-320:
		tmp = math.sqrt(((A * (c0 / (l / c0))) / V))
	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)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(sqrt(Float64(A / V)) * c0) * (l ^ -0.5));
	elseif (Float64(V * l) <= -2e-323)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 4e-320)
		tmp = sqrt(Float64(Float64(A * Float64(c0 / Float64(l / c0))) / V));
	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)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (sqrt((A / V)) * c0) * (l ^ -0.5);
	elseif ((V * l) <= -2e-323)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 4e-320)
		tmp = sqrt(((A * (c0 / (l / c0))) / V));
	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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-323], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-320], N[Sqrt[N[(N[(A * N[(c0 / N[(l / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / V), $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}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\left(\sqrt{\frac{A}{V}} \cdot c0\right) \cdot {\ell}^{-0.5}\\

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

\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-320}:\\
\;\;\;\;\sqrt{\frac{A \cdot \frac{c0}{\frac{\ell}{c0}}}{V}}\\

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


\end{array}

Local Percentage Accuracy?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 10 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each of Herbie's proposed alternatives. Up and to the right is better. Each dot represents an alternative program; the red square represents the initial program.

Bogosity?

Bogosity

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 40.8%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
      Step-by-step derivation

      [Start]40.8

      \[ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]

      pow1/2 [=>]40.8

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

      clear-num [=>]40.8

      \[ c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]

      inv-pow [=>]40.8

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

      pow-pow [=>]40.8

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

      associate-/l* [=>]68.0

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

      metadata-eval [=>]68.0

      \[ c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{-0.5}} \]
    3. Simplified40.8%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}} \]
      Step-by-step derivation

      [Start]68.0

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

      associate-/l* [<=]40.8

      \[ c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
    4. Applied egg-rr68.2%

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

      [Start]40.8

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

      associate-*r/ [<=]68.2

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

      metadata-eval [<=]68.2

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

      pow-flip [<=]68.2

      \[ c0 \cdot \color{blue}{\frac{1}{{\left(V \cdot \frac{\ell}{A}\right)}^{0.5}}} \]

      pow1/2 [<=]68.2

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

      un-div-inv [=>]68.2

      \[ \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    5. Simplified68.2%

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

      [Start]68.2

      \[ \frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}} \]

      associate-*r/ [=>]40.8

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

      associate-*l/ [<=]68.2

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

      *-commutative [<=]68.2

      \[ \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{V}{A}}}} \]
    6. Applied egg-rr40.0%

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

      [Start]68.2

      \[ \frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}} \]

      *-un-lft-identity [=>]68.2

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

      add-sqr-sqrt [=>]68.0

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

      times-frac [=>]68.0

      \[ \color{blue}{\frac{1}{\sqrt{\sqrt{\ell \cdot \frac{V}{A}}}} \cdot \frac{c0}{\sqrt{\sqrt{\ell \cdot \frac{V}{A}}}}} \]
    7. Simplified43.1%

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

      [Start]40.0

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

      associate-*l/ [=>]40.0

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

      *-commutative [<=]40.0

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

      times-frac [=>]43.1

      \[ \sqrt{\color{blue}{\frac{A}{V} \cdot \frac{c0 \cdot c0}{\ell}}} \]
    8. Applied egg-rr49.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot c0\right) \cdot {\ell}^{-0.5}} \]
      Step-by-step derivation

      [Start]43.1

      \[ \sqrt{\frac{A}{V} \cdot \frac{c0 \cdot c0}{\ell}} \]

      associate-*r/ [=>]48.0

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

      add-sqr-sqrt [=>]47.3

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

      unswap-sqr [=>]47.8

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

      add-sqr-sqrt [=>]21.9

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

      frac-times [<=]21.9

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

      associate-*l/ [<=]21.7

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

      associate-*l/ [<=]21.7

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

      sqrt-unprod [<=]33.1

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

      add-sqr-sqrt [<=]49.6

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

      associate-*l/ [=>]49.7

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

      div-inv [=>]49.7

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

      pow1/2 [=>]49.7

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

      pow-flip [=>]49.9

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

      metadata-eval [=>]49.9

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

    if -inf.0 < (*.f64 V l) < -1.97626e-323

    1. Initial program 83.8%

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

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

      [Start]83.8

      \[ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]

      frac-2neg [=>]83.8

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

      sqrt-div [=>]98.8

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

      *-commutative [=>]98.8

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

      distribute-rgt-neg-in [=>]98.8

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

    if -1.97626e-323 < (*.f64 V l) < 3.99996e-320

    1. Initial program 35.9%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
      Step-by-step derivation

      [Start]35.9

      \[ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]

      pow1/2 [=>]35.9

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

      clear-num [=>]35.9

      \[ c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]

      inv-pow [=>]35.9

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

      pow-pow [=>]35.9

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

      associate-/l* [=>]50.5

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

      metadata-eval [=>]50.5

      \[ c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{-0.5}} \]
    3. Simplified35.9%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}} \]
      Step-by-step derivation

      [Start]50.5

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

      associate-/l* [<=]35.9

      \[ c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
    4. Applied egg-rr50.5%

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

      [Start]35.9

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

      associate-*r/ [<=]50.4

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

      metadata-eval [<=]50.4

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

      pow-flip [<=]50.5

      \[ c0 \cdot \color{blue}{\frac{1}{{\left(V \cdot \frac{\ell}{A}\right)}^{0.5}}} \]

      pow1/2 [<=]50.5

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

      un-div-inv [=>]50.5

      \[ \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    5. Simplified50.6%

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

      [Start]50.5

      \[ \frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}} \]

      associate-*r/ [=>]35.9

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

      associate-*l/ [<=]50.6

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

      *-commutative [<=]50.6

      \[ \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{V}{A}}}} \]
    6. Applied egg-rr24.7%

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

      [Start]50.6

      \[ \frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}} \]

      *-un-lft-identity [=>]50.6

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

      add-sqr-sqrt [=>]50.4

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

      times-frac [=>]50.4

      \[ \color{blue}{\frac{1}{\sqrt{\sqrt{\ell \cdot \frac{V}{A}}}} \cdot \frac{c0}{\sqrt{\sqrt{\ell \cdot \frac{V}{A}}}}} \]
    7. Simplified41.4%

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

      [Start]24.7

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

      associate-*l/ [=>]23.2

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

      *-commutative [<=]23.2

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

      times-frac [=>]41.4

      \[ \sqrt{\color{blue}{\frac{A}{V} \cdot \frac{c0 \cdot c0}{\ell}}} \]
    8. Applied egg-rr57.0%

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

      [Start]41.4

      \[ \sqrt{\frac{A}{V} \cdot \frac{c0 \cdot c0}{\ell}} \]

      associate-*l/ [=>]40.9

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

      associate-/l* [=>]57.0

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

    if 3.99996e-320 < (*.f64 V l)

    1. Initial program 82.3%

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

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

      [Start]82.3

      \[ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]

      sqrt-div [=>]94.9

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

      associate-*r/ [=>]91.3

      \[ \color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}} \]
    3. Simplified95.0%

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

      [Start]91.3

      \[ \frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}} \]

      associate-/l* [=>]95.0

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

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

Alternatives

Alternative 1
Accuracy78.4%
Cost27724
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ t_1 := c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{-215}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{-302}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+305}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{A \cdot \frac{c0}{\frac{\ell}{c0}}}{V}}\\ \end{array} \]
Alternative 2
Accuracy78.1%
Cost27724
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{-124}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\ \mathbf{elif}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+305}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{A \cdot \frac{c0}{\frac{\ell}{c0}}}{V}}\\ \end{array} \]
Alternative 3
Accuracy81.4%
Cost13380
\[\begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 4
Accuracy83.7%
Cost13380
\[\begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 5
Accuracy79.2%
Cost7625
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+241}\right):\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 6
Accuracy78.1%
Cost7625
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-234} \lor \neg \left(t_0 \leq 10^{+276}\right):\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 7
Accuracy75.3%
Cost7300
\[\begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 4 \cdot 10^{-230}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \end{array} \]
Alternative 8
Accuracy75.8%
Cost7236
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 2 \cdot 10^{-246}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 9
Accuracy73.2%
Cost6848
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]

Reproduce?

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