Average Error: 18.3 → 10.4
Time: 11.0s
Precision: 64
Internal Precision: 128
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell = -\infty:\\ \;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le -3.759573221325006 \cdot 10^{-219}:\\ \;\;\;\;\sqrt{\frac{1}{V \cdot \ell} \cdot A} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 4.5117310137652915 \cdot 10^{-291}:\\ \;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 4.368285262596396 \cdot 10^{+294}:\\ \;\;\;\;\left(\sqrt{\frac{1}{V \cdot \ell}} \cdot \sqrt{A}\right) \cdot c0\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot c0\right) \cdot \sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}}\\ \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 4 regimes
  2. if (* V l) < -inf.0 or -3.759573221325006e-219 < (* V l) < 4.5117310137652915e-291

    1. Initial program 44.9

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied associate-/r*28.6

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

    if -inf.0 < (* V l) < -3.759573221325006e-219

    1. Initial program 7.8

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

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

    if 4.5117310137652915e-291 < (* V l) < 4.368285262596396e+294

    1. Initial program 9.1

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

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

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

    if 4.368285262596396e+294 < (* V l)

    1. Initial program 38.5

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied associate-/r*21.7

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt21.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell = -\infty:\\ \;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le -3.759573221325006 \cdot 10^{-219}:\\ \;\;\;\;\sqrt{\frac{1}{V \cdot \ell} \cdot A} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 4.5117310137652915 \cdot 10^{-291}:\\ \;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 4.368285262596396 \cdot 10^{+294}:\\ \;\;\;\;\left(\sqrt{\frac{1}{V \cdot \ell}} \cdot \sqrt{A}\right) \cdot c0\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot c0\right) \cdot \sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}}\\ \end{array}\]

Reproduce

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

Details

Time bar (total: 9.2s)Debug log

sample86.0ms

Algorithm
intervals
Results
32.0ms278×body80valid
32.0ms290×body80nan

simplify3.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
3.0ms
(* c0 (sqrt (/ A (* V l))))

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 17.2b

localize12.0ms

Local error

Found 3 expressions with local error:

14.7b
(sqrt (/ A (* V l)))
6.6b
(/ A (* V l))
1.1b
(* c0 (sqrt (/ A (* V l))))

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
sqrt-prod
associate-*r*
add-sqr-sqrt
add-cube-cbrt
*-un-lft-identity
add-log-exp
div-inv
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
sqrt-div
*-commutative
associate-*r/
pow1/2
frac-2neg
associate-/r*
clear-num
rem-sqrt-square
Counts
3 → 47
Calls
3 calls:
Slowest
2.0ms
(* c0 (sqrt (/ A (* V l))))
1.0ms
(sqrt (/ A (* V l)))
0.0ms
(/ A (* V l))

series102.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
48.0ms
(* c0 (sqrt (/ A (* V l))))
33.0ms
(sqrt (/ A (* V l)))
21.0ms
(/ A (* V l))

simplify48.0ms

Counts
23 → 56
Calls
23 calls:
Slowest
6.0ms
(/ A (* l V))
4.0ms
(/ A (* l V))
4.0ms
(/ A (* l V))
3.0ms
(sqrt (* (cbrt (/ A (* V l))) (cbrt (/ A (* V l)))))
3.0ms
(sqrt (sqrt (/ A (* V l))))

prune586.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 8.3b

localize9.0ms

Local error

Found 3 expressions with local error:

14.7b
(sqrt (/ (/ A V) l))
4.0b
(/ (/ A V) l)
1.1b
(* c0 (sqrt (/ (/ A V) l)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Rules
sqrt-prod
add-sqr-sqrt
add-cube-cbrt
associate-*r*
*-un-lft-identity
associate-/l*
div-inv
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
sqrt-div
associate-/l/
*-commutative
associate-*r/
pow1/2
frac-2neg
clear-num
rem-sqrt-square
Counts
3 → 51
Calls
3 calls:
Slowest
3.0ms
(/ (/ A V) l)
2.0ms
(* c0 (sqrt (/ (/ A V) l)))
1.0ms
(sqrt (/ (/ A V) l))

series106.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
55.0ms
(* c0 (sqrt (/ (/ A V) l)))
32.0ms
(sqrt (/ (/ A V) l))
19.0ms
(/ (/ A V) l)

simplify77.0ms

Counts
25 → 60
Calls
25 calls:
Slowest
10.0ms
(sqrt (* (cbrt (/ (/ A V) l)) (cbrt (/ (/ A V) l))))
8.0ms
(sqrt (sqrt (/ (/ A V) l)))
7.0ms
(sqrt (/ (/ A V) l))
6.0ms
(cbrt (sqrt (/ (/ A V) l)))
4.0ms
(sqrt (/ A V))

prune612.0ms

Pruning

14 alts after pruning (13 fresh and 1 done)

Merged error: 6.2b

localize12.0ms

Local error

Found 4 expressions with local error:

14.7b
(sqrt (/ (/ A V) l))
14.7b
(sqrt (/ (/ A V) l))
4.0b
(/ (/ A V) l)
4.0b
(/ (/ A V) l)

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
10×add-sqr-sqrt
associate-/l*
sqrt-prod
add-cube-cbrt
*-un-lft-identity
div-inv
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
associate-/l/
sqrt-div
pow1/2
frac-2neg
clear-num
rem-sqrt-square
Counts
4 → 66
Calls
4 calls:
Slowest
2.0ms
(/ (/ A V) l)
2.0ms
(/ (/ A V) l)
1.0ms
(sqrt (/ (/ A V) l))
1.0ms
(sqrt (/ (/ A V) l))

series81.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
29.0ms
(sqrt (/ (/ A V) l))
21.0ms
(sqrt (/ (/ A V) l))
18.0ms
(/ (/ A V) l)
13.0ms
(/ (/ A V) l)

simplify96.0ms

Counts
28 → 78
Calls
28 calls:
Slowest
10.0ms
(sqrt (* (cbrt (/ (/ A V) l)) (cbrt (/ (/ A V) l))))
10.0ms
(sqrt (* (cbrt (/ (/ A V) l)) (cbrt (/ (/ A V) l))))
8.0ms
(sqrt (sqrt (/ (/ A V) l)))
7.0ms
(sqrt (/ (/ A V) l))
7.0ms
(sqrt (/ (/ A V) l))

prune985.0ms

Pruning

14 alts after pruning (12 fresh and 2 done)

Merged error: 6.2b

localize17.0ms

Local error

Found 4 expressions with local error:

16.3b
(cbrt (/ (/ A V) l))
16.3b
(cbrt (/ (/ A V) l))
14.7b
(sqrt (/ (/ A V) l))
4.0b
(/ (/ A V) l)

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
add-cube-cbrt
*-un-lft-identity
cbrt-prod
div-inv
add-log-exp
associate-/l*
log1p-expm1-u
sqrt-prod
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
pow1/3
cbrt-div
associate-/l/
sqrt-div
pow1/2
frac-2neg
clear-num
rem-sqrt-square
Counts
4 → 63
Calls
4 calls:
Slowest
5.0ms
(/ (/ A V) l)
2.0ms
(sqrt (/ (/ A V) l))
1.0ms
(cbrt (/ (/ A V) l))
1.0ms
(cbrt (/ (/ A V) l))

series245.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
102.0ms
(cbrt (/ (/ A V) l))
101.0ms
(cbrt (/ (/ A V) l))
30.0ms
(sqrt (/ (/ A V) l))
12.0ms
(/ (/ A V) l)

simplify1.6s

Counts
30 → 75
Calls
30 calls:
Slowest
397.0ms
(exp (* 1/3 (- (+ (log (/ 1 l)) (log (/ 1 V))) (log (/ 1 A)))))
349.0ms
(exp (* 1/3 (- (+ (log (/ 1 l)) (log (/ 1 V))) (log (/ 1 A)))))
221.0ms
(exp (* 1/3 (- (log A) (+ (log l) (log V)))))
213.0ms
(exp (* 1/3 (- (log A) (+ (log l) (log V)))))
200.0ms
(* (exp (* 1/3 (- (+ (log (/ -1 V)) (log (/ -1 l))) (log (/ -1 A))))) (cbrt -1))

prune1.3s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 6.2b

regimes956.0ms

Accuracy

71.6% (3.1b remaining)

Error of 10.4b against oracle of 7.3b and baseline of 18.3b

bsearch6.0ms

end0.0ms

sample2.3s

Algorithm
intervals
Results
889.0ms8861×body80valid
875.0ms8813×body80nan