Average Error: 18.7 → 10.3
Time: 16.2s
Precision: 64
Internal Precision: 128
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -6.279111945542786 \cdot 10^{-272}:\\ \;\;\;\;\left(\sqrt{\frac{\sqrt[3]{\frac{1}{V \cdot \ell}} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}{\sqrt[3]{\frac{1}{A}} \cdot \sqrt[3]{\frac{1}{A}}}} \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{\frac{1}{V \cdot \ell}}}{\sqrt[3]{\frac{1}{A}}}}\\ \mathbf{elif}\;V \cdot \ell \le 0.0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A} \cdot \sqrt{\frac{1}{V \cdot \ell}}\right) \cdot c0\\ \end{array}\]

Error

Bits error versus c0

Bits error versus A

Bits error versus V

Bits error versus l

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (* V l) < -6.279111945542786e-272

    1. Initial program 13.9

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied clear-num14.2

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}}\]
    4. Using strategy rm
    5. Applied div-inv14.3

      \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\left(V \cdot \ell\right) \cdot \frac{1}{A}}}}\]
    6. Applied associate-/r*13.9

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V \cdot \ell}}{\frac{1}{A}}}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt14.3

      \[\leadsto c0 \cdot \sqrt{\frac{\frac{1}{V \cdot \ell}}{\color{blue}{\left(\sqrt[3]{\frac{1}{A}} \cdot \sqrt[3]{\frac{1}{A}}\right) \cdot \sqrt[3]{\frac{1}{A}}}}}\]
    9. Applied add-cube-cbrt14.4

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{\frac{1}{V \cdot \ell}} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right) \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}}{\left(\sqrt[3]{\frac{1}{A}} \cdot \sqrt[3]{\frac{1}{A}}\right) \cdot \sqrt[3]{\frac{1}{A}}}}\]
    10. Applied times-frac14.4

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{\sqrt[3]{\frac{1}{V \cdot \ell}} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}{\sqrt[3]{\frac{1}{A}} \cdot \sqrt[3]{\frac{1}{A}}}} \cdot \sqrt{\frac{\sqrt[3]{\frac{1}{V \cdot \ell}}}{\sqrt[3]{\frac{1}{A}}}}\right)}\]
    12. Applied associate-*r*8.2

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

    if -6.279111945542786e-272 < (* V l) < 0.0

    1. Initial program 54.6

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied clear-num54.6

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}}\]
    4. Using strategy rm
    5. Applied div-inv54.6

      \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\left(V \cdot \ell\right) \cdot \frac{1}{A}}}}\]
    6. Applied associate-/r*55.6

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V \cdot \ell}}{\frac{1}{A}}}}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity55.6

      \[\leadsto c0 \cdot \sqrt{\frac{\frac{1}{V \cdot \ell}}{\color{blue}{1 \cdot \frac{1}{A}}}}\]
    9. Applied div-inv55.6

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{1 \cdot \frac{1}{V \cdot \ell}}}{1 \cdot \frac{1}{A}}}\]
    10. Applied times-frac55.6

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{1} \cdot \frac{\frac{1}{V \cdot \ell}}{\frac{1}{A}}}}\]
    11. Simplified55.6

      \[\leadsto c0 \cdot \sqrt{\color{blue}{1} \cdot \frac{\frac{1}{V \cdot \ell}}{\frac{1}{A}}}\]
    12. Simplified33.1

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

    if 0.0 < (* V l)

    1. Initial program 15.7

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied clear-num16.0

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}}\]
    4. Using strategy rm
    5. Applied div-inv16.0

      \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\left(V \cdot \ell\right) \cdot \frac{1}{A}}}}\]
    6. Applied associate-/r*16.0

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V \cdot \ell}}{\frac{1}{A}}}}\]
    7. Using strategy rm
    8. Applied associate-/r/16.0

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V \cdot \ell}}{1} \cdot A}}\]
    9. Applied sqrt-prod7.4

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{\frac{1}{V \cdot \ell}}{1}} \cdot \sqrt{A}\right)}\]
    10. Simplified7.4

      \[\leadsto c0 \cdot \left(\color{blue}{\sqrt{\frac{1}{\ell \cdot V}}} \cdot \sqrt{A}\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -6.279111945542786 \cdot 10^{-272}:\\ \;\;\;\;\left(\sqrt{\frac{\sqrt[3]{\frac{1}{V \cdot \ell}} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}{\sqrt[3]{\frac{1}{A}} \cdot \sqrt[3]{\frac{1}{A}}}} \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{\frac{1}{V \cdot \ell}}}{\sqrt[3]{\frac{1}{A}}}}\\ \mathbf{elif}\;V \cdot \ell \le 0.0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A} \cdot \sqrt{\frac{1}{V \cdot \ell}}\right) \cdot c0\\ \end{array}\]

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  (* c0 (sqrt (/ A (* V l)))))

Details

Time bar (total: 10.2s)Debug log

start130.0ms

Algorithm
intervals

setup30.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 13.1b

localize16.0ms

Local error

Found 3 expressions with local error:

16.0b
(sqrt (/ A (* V l)))
3.2b
(/ A (* V l))
0.6b
(* c0 (sqrt (/ A (* V l))))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
3 → 47
Calls

3 calls. Slowest were:

2.0ms
(* c0 (sqrt (/ A (* V l))))
1.0ms
(sqrt (/ A (* V l)))
0.0ms
(/ A (* V l))

series92.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

42.0ms
(* c0 (sqrt (/ A (* V l))))
33.0ms
(sqrt (/ A (* V l)))
17.0ms
(/ A (* V l))

simplify42.0ms

Counts
23 → 56
Calls

23 calls. Slowest were:

4.0ms
(/ A (* l V))
3.0ms
(sqrt (* (cbrt (/ A (* V l))) (cbrt (/ A (* V l)))))
3.0ms
(sqrt (/ A (* V l)))

prune762.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 9.9b

localize11.0ms

Local error

Found 4 expressions with local error:

16.0b
(sqrt (/ A (* V l)))
16.0b
(sqrt (/ A (* V l)))
3.2b
(/ A (* V l))
3.2b
(/ A (* V l))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

2.0ms
(sqrt (/ A (* V l)))
2.0ms
(sqrt (/ A (* V l)))
1.0ms
(/ A (* V l))

series91.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

30.0ms
(sqrt (/ A (* V l)))
21.0ms
(/ A (* V l))
20.0ms
(sqrt (/ A (* V l)))
19.0ms
(/ A (* V l))

simplify46.0ms

Counts
24 → 70
Calls

24 calls. Slowest were:

4.0ms
(sqrt (* (cbrt (/ A (* V l))) (cbrt (/ A (* V l)))))
4.0ms
(/ A (* l V))
4.0ms
(/ A (* l V))

prune902.0ms

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 9.9b

localize23.0ms

Local error

Found 4 expressions with local error:

16.0b
(sqrt (/ 1 (/ (* V l) A)))
3.1b
(/ (* V l) A)
0.6b
(* c0 (sqrt (/ 1 (/ (* V l) A))))
0.4b
(/ 1 (/ (* V l) A))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 69
Calls

4 calls. Slowest were:

5.0ms
(/ (* V l) A)
3.0ms
(* c0 (sqrt (/ 1 (/ (* V l) A))))
2.0ms
(/ 1 (/ (* V l) A))

series117.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

41.0ms
(sqrt (/ 1 (/ (* V l) A)))
35.0ms
(* c0 (sqrt (/ 1 (/ (* V l) A))))
25.0ms
(/ (* V l) A)
15.0ms
(/ 1 (/ (* V l) A))

simplify613.0ms

Counts
33 → 81
Calls

33 calls. Slowest were:

65.0ms
(sqrt (/ 1 (/ (* V l) A)))
62.0ms
(sqrt (/ 1 (/ (* V l) A)))
61.0ms
(sqrt (sqrt (/ 1 (/ (* V l) A))))

prune901.0ms

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 9.8b

localize29.0ms

Local error

Found 4 expressions with local error:

16.0b
(sqrt (/ (/ 1 (* V l)) (/ 1 A)))
3.3b
(/ (/ 1 (* V l)) (/ 1 A))
0.6b
(* c0 (sqrt (/ (/ 1 (* V l)) (/ 1 A))))
0.4b
(/ 1 (* V l))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 126
Calls

4 calls. Slowest were:

8.0ms
(/ (/ 1 (* V l)) (/ 1 A))
5.0ms
(* c0 (sqrt (/ (/ 1 (* V l)) (/ 1 A))))
3.0ms
(sqrt (/ (/ 1 (* V l)) (/ 1 A)))

series113.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

60.0ms
(* c0 (sqrt (/ (/ 1 (* V l)) (/ 1 A))))
25.0ms
(sqrt (/ (/ 1 (* V l)) (/ 1 A)))
17.0ms
(/ (/ 1 (* V l)) (/ 1 A))
11.0ms
(/ 1 (* V l))

simplify3.5s

Counts
103 → 138
Calls

103 calls. Slowest were:

232.0ms
(- (log (/ 1 (* V l))) (log (/ 1 A)))
186.0ms
(sqrt (* (cbrt (/ (/ 1 (* V l)) (/ 1 A))) (cbrt (/ (/ 1 (* V l)) (/ 1 A)))))
167.0ms
(sqrt (/ (/ 1 (* V l)) (/ 1 A)))

prune1.9s

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 5.5b

regimes849.0ms

Accuracy

45.3% (3.7b remaining)

Error of 10.3b against oracle of 6.6b and baseline of 13.3b

bsearch5.0ms