Henrywood and Agarwal, Equation (3)

?

Percentage Accurate: 73.1% → 96.9%
Time: 14.7s
Precision: binary64
Cost: 26112

?

\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[c0 \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{\ell} \cdot \sqrt[3]{V}}\right)}^{1.5} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (* c0 (pow (/ (cbrt A) (* (cbrt l) (cbrt V))) 1.5)))
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) {
	return c0 * pow((cbrt(A) / (cbrt(l) * cbrt(V))), 1.5);
}
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) {
	return c0 * Math.pow((Math.cbrt(A) / (Math.cbrt(l) * Math.cbrt(V))), 1.5);
}
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
function code(c0, A, V, l)
	return Float64(c0 * (Float64(cbrt(A) / Float64(cbrt(l) * cbrt(V))) ^ 1.5))
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[Power[A, 1/3], $MachinePrecision] / N[(N[Power[l, 1/3], $MachinePrecision] * N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
c0 \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{\ell} \cdot \sqrt[3]{V}}\right)}^{1.5}

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 16 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. Initial program 72.0%

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

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

    [Start]72.0

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

    pow1/2 [=>]72.0

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

    add-cube-cbrt [=>]71.6

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

    pow3 [=>]71.6

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

    pow-pow [=>]71.6

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

    metadata-eval [=>]71.6

    \[ c0 \cdot {\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{\color{blue}{1.5}} \]
  3. Applied egg-rr83.0%

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

    [Start]71.6

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

    cbrt-div [=>]83.2

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

    div-inv [=>]83.0

    \[ c0 \cdot {\color{blue}{\left(\sqrt[3]{A} \cdot \frac{1}{\sqrt[3]{V \cdot \ell}}\right)}}^{1.5} \]
  4. Simplified83.2%

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

    [Start]83.0

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

    associate-*r/ [=>]83.2

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

    *-rgt-identity [=>]83.2

    \[ c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{A}}}{\sqrt[3]{V \cdot \ell}}\right)}^{1.5} \]
  5. Applied egg-rr96.9%

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

    [Start]83.2

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

    *-commutative [=>]83.2

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

    cbrt-prod [=>]96.9

    \[ c0 \cdot {\left(\frac{\sqrt[3]{A}}{\color{blue}{\sqrt[3]{\ell} \cdot \sqrt[3]{V}}}\right)}^{1.5} \]
  6. Final simplification96.9%

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

Alternatives

Alternative 1
Accuracy78.5%
Cost27725
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{-307} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 2 \cdot 10^{+290}:\\ \;\;\;\;c0 \cdot {\left(\frac{\ell \cdot V}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0}{V} \cdot \frac{c0}{\ell}\right)}\\ \end{array} \]
Alternative 2
Accuracy79.0%
Cost27725
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{-307} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 2 \cdot 10^{+290}:\\ \;\;\;\;c0 \cdot {\left(\frac{\ell \cdot V}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{c0}{V} \cdot \left(A \cdot \frac{c0}{\ell}\right)}\\ \end{array} \]
Alternative 3
Accuracy79.0%
Cost27725
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{-307} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 2 \cdot 10^{+290}:\\ \;\;\;\;c0 \cdot {\left(\frac{\ell \cdot V}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{A}{\frac{\ell}{c0}}}\\ \end{array} \]
Alternative 4
Accuracy82.3%
Cost14608
\[\begin{array}{l} \mathbf{if}\;\ell \cdot V \leq -\infty:\\ \;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\ \mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-227}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\ \mathbf{elif}\;\ell \cdot V \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;\ell \cdot V \leq 10^{+283}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left({\left(\frac{-1}{V}\right)}^{0.5} \cdot {\left(\frac{-\ell}{A}\right)}^{-0.5}\right)\\ \end{array} \]
Alternative 5
Accuracy82.3%
Cost14417
\[\begin{array}{l} \mathbf{if}\;\ell \cdot V \leq -\infty:\\ \;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\ \mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-227}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\ \mathbf{elif}\;\ell \cdot V \leq 0 \lor \neg \left(\ell \cdot V \leq 10^{+283}\right):\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\ \end{array} \]
Alternative 6
Accuracy88.8%
Cost14288
\[\begin{array}{l} \mathbf{if}\;\ell \cdot V \leq -\infty:\\ \;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\ \mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-293}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\ \mathbf{elif}\;\ell \cdot V \leq 0:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+300}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \]
Alternative 7
Accuracy78.8%
Cost13380
\[\begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 8
Accuracy62.0%
Cost13380
\[\begin{array}{l} \mathbf{if}\;A \leq 1.9 \cdot 10^{-308}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\ \end{array} \]
Alternative 9
Accuracy63.4%
Cost13380
\[\begin{array}{l} \mathbf{if}\;A \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\ \end{array} \]
Alternative 10
Accuracy79.6%
Cost7688
\[\begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t_0 \leq 2 \cdot 10^{-314}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{+279}:\\ \;\;\;\;c0 \cdot {\left(\frac{\ell \cdot V}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \end{array} \]
Alternative 11
Accuracy79.5%
Cost7625
\[\begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+303}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 12
Accuracy78.8%
Cost7625
\[\begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+242}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 13
Accuracy79.8%
Cost7625
\[\begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+303}\right):\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
Alternative 14
Accuracy79.7%
Cost7624
\[\begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{+279}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \end{array} \]
Alternative 15
Accuracy73.1%
Cost6848
\[c0 \cdot \sqrt{\frac{A}{\ell \cdot V}} \]

Reproduce?

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