Average Error: 12.8 → 8.7
Time: 35.1s
Precision: 64
Internal Precision: 128
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[\begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \le -1.228549641598271 \cdot 10^{+240}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\left(M \cdot D\right) \cdot h\right)}{\ell \cdot \left(2 \cdot d\right)}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}}\\ \end{array}\]

Error

Bits error versus w0

Bits error versus M

Bits error versus D

Bits error versus h

Bits error versus l

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (* (pow (/ (* M D) (* 2 d)) 2) (/ h l)) < -1.228549641598271e+240

    1. Initial program 56.7

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Using strategy rm
    3. Applied associate-*r/53.6

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}}\]
    4. Using strategy rm
    5. Applied unpow253.6

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)} \cdot h}{\ell}}\]
    6. Applied associate-*l*49.0

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)}}{\ell}}\]
    7. Using strategy rm
    8. Applied associate-*l/50.4

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \color{blue}{\frac{\left(M \cdot D\right) \cdot h}{2 \cdot d}}}{\ell}}\]
    9. Applied associate-*r/50.6

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\left(M \cdot D\right) \cdot h\right)}{2 \cdot d}}}{\ell}}\]
    10. Applied associate-/l/50.6

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\left(M \cdot D\right) \cdot h\right)}{\ell \cdot \left(2 \cdot d\right)}}}\]

    if -1.228549641598271e+240 < (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))

    1. Initial program 5.7

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Using strategy rm
    3. Applied associate-*r/2.9

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}}\]
    4. Using strategy rm
    5. Applied unpow22.9

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)} \cdot h}{\ell}}\]
    6. Applied associate-*l*1.9

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)}}{\ell}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \le -1.228549641598271 \cdot 10^{+240}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\left(M \cdot D\right) \cdot h\right)}{\ell \cdot \left(2 \cdot d\right)}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}}\\ \end{array}\]

Reproduce

herbie shell --seed 2018365 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))

Details

Time bar (total: 28.1s)Debug log

start142.0ms

Algorithm
intervals

setup105.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 13.3b

localize32.0ms

Local error

Found 4 expressions with local error:

9.7b
(* (pow (/ (* M D) (* 2 d)) 2) (/ h l))
5.1b
(/ (* M D) (* 2 d))
4.2b
(sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))
2.6b
(* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l)))))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
4 → 72
Calls

4 calls. Slowest were:

8.0ms
(* (pow (/ (* M D) (* 2 d)) 2) (/ h l))
6.0ms
(/ (* M D) (* 2 d))
4.0ms
(* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l)))))

series462.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

235.0ms
(* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l)))))
118.0ms
(sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))
88.0ms
(* (pow (/ (* M D) (* 2 d)) 2) (/ h l))
21.0ms
(/ (* M D) (* 2 d))

simplify4.5s

Counts
47 → 84
Calls

47 calls. Slowest were:

804.0ms
(sqrt (+ 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))
345.0ms
(+ (log (pow (/ (* M D) (* 2 d)) 2)) (log (/ h l)))
316.0ms
(* (cbrt (pow (/ (* M D) (* 2 d)) 2)) (cbrt (pow (/ (* M D) (* 2 d)) 2)))

prune1.6s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 8.1b

localize18.0ms

Local error

Found 4 expressions with local error:

5.7b
(* (pow (/ (* M D) (* 2 d)) 2) h)
5.1b
(/ (* M D) (* 2 d))
5.0b
(/ (* (pow (/ (* M D) (* 2 d)) 2) h) l)
4.2b
(sqrt (- 1 (/ (* (pow (/ (* M D) (* 2 d)) 2) h) l)))

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 57
Calls

4 calls. Slowest were:

11.0ms
(/ (* (pow (/ (* M D) (* 2 d)) 2) h) l)
6.0ms
(* (pow (/ (* M D) (* 2 d)) 2) h)
5.0ms
(/ (* M D) (* 2 d))

series301.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

133.0ms
(sqrt (- 1 (/ (* (pow (/ (* M D) (* 2 d)) 2) h) l)))
75.0ms
(/ (* (pow (/ (* M D) (* 2 d)) 2) h) l)
63.0ms
(* (pow (/ (* M D) (* 2 d)) 2) h)
29.0ms
(/ (* M D) (* 2 d))

simplify5.8s

Counts
31 → 69
Calls

31 calls. Slowest were:

872.0ms
(sqrt (- 1 (/ (* (pow (/ (* M D) (* 2 d)) 2) h) l)))
834.0ms
(sqrt (sqrt (- 1 (/ (* (pow (/ (* M D) (* 2 d)) 2) h) l))))
831.0ms
(sqrt (* (cbrt (- 1 (/ (* (pow (/ (* M D) (* 2 d)) 2) h) l))) (cbrt (- 1 (/ (* (pow (/ (* M D) (* 2 d)) 2) h) l)))))

prune1.3s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 7.2b

localize33.0ms

Local error

Found 4 expressions with local error:

5.4b
(* (/ (* M D) (* 2 d)) h)
5.1b
(/ (* M D) (* 2 d))
5.1b
(/ (* M D) (* 2 d))
5.0b
(/ (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) l)

rewrite45.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

25.0ms
(/ (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) l)
8.0ms
(* (/ (* M D) (* 2 d)) h)
5.0ms
(/ (* M D) (* 2 d))

series160.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

68.0ms
(/ (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) l)
38.0ms
(* (/ (* M D) (* 2 d)) h)
27.0ms
(/ (* M D) (* 2 d))
26.0ms
(/ (* M D) (* 2 d))

simplify3.4s

Counts
29 → 70
Calls

29 calls. Slowest were:

718.0ms
(* (* M D) (* (/ (* M D) (* 2 d)) h))
600.0ms
(* (/ (* M D) (* 2 d)) (* (* M D) h))
274.0ms
(* 1/2 (/ (* M (* D h)) d))

prune1.4s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 7.2b

localize42.0ms

Local error

Found 4 expressions with local error:

28.7b
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))
28.7b
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))
28.7b
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))
5.7b
(* (pow (/ (* M D) (* 2 d)) 2) h)

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

8.0ms
(* (pow (/ (* M D) (* 2 d)) 2) h)
3.0ms
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))
3.0ms
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))

series621.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

219.0ms
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))
171.0ms
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))
155.0ms
(cbrt (* (pow (/ (* M D) (* 2 d)) 2) h))
76.0ms
(* (pow (/ (* M D) (* 2 d)) 2) h)

simplify4.2s

Counts
23 → 56
Calls

23 calls. Slowest were:

371.0ms
(* 1/4 (/ (* (pow M 2) (* (pow D 2) h)) (pow d 2)))
359.0ms
(* 1/4 (/ (* (pow M 2) (* (pow D 2) h)) (pow d 2)))
355.0ms
(* 1/4 (/ (* (pow M 2) (* (pow D 2) h)) (pow d 2)))

prune1.4s

Pruning

9 alts after pruning (7 fresh and 2 done)

Merged error: 7.2b

regimes2.4s

Accuracy

-13.8% (1.8b remaining)

Error of 8.7b against oracle of 6.9b and baseline of 8.5b

bsearch12.0ms