Average Error: 58.1 → 33.7
Time: 53.1s
Precision: 64
Internal Precision: 128
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)\]
\[0\]

Error

Bits error versus c0

Bits error versus w

Bits error versus h

Bits error versus D

Bits error versus d

Bits error versus M

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.1

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)\]
  2. Taylor expanded around inf 35.4

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0}\]
  3. Taylor expanded around inf 33.7

    \[\leadsto \color{blue}{0}\]
  4. Final simplification33.7

    \[\leadsto 0\]

Reproduce

herbie shell --seed 2019016 +o rules:numerics
(FPCore (c0 w h D d M)
  :name "Henrywood and Agarwal, Equation (13)"
  (* (/ c0 (* 2 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))

Details

Time bar (total: 51.6s)Debug log

sample690.0ms

Algorithm
intervals
Results
843×(pre true 80)
431×(body nan 80)
208×(body real 80)
70×(body real 5120)
51×(body real 2560)
35×(body real 1280)
20×(body exit 10240)
13×(body real 640)
10×(body real 320)
(body real 160)

simplify436.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
435.0ms
(* (/ c0 (* 2 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M)))))

prune10.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 57.2b

localize57.0ms

Local error

Found 4 expressions with local error:

25.3b
(+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))
17.4b
(/ (* c0 (* d d)) (* (* w h) (* D D)))
17.4b
(/ (* c0 (* d d)) (* (* w h) (* D D)))
17.4b
(/ (* c0 (* d d)) (* (* w h) (* D D)))

rewrite98.0ms

Algorithm
rewrite-expression-head
Rules
19×add-exp-log
19×add-cbrt-cube
*-un-lft-identity
add-log-exp
div-exp
cbrt-undiv
add-cube-cbrt
fma-def
add-sqr-sqrt
div-inv
log1p-expm1-u
times-frac
pow1
expm1-log1p-u
associate-/l*
cbrt-unprod
prod-exp
frac-2neg
associate-/r*
clear-num
frac-add
sqrt-div
distribute-lft-out
flip--
flip-+
flip3--
flip3-+
sum-log
+-commutative
Counts
4 → 78
Calls
4 calls:
Slowest
64.0ms
(+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))
11.0ms
(/ (* c0 (* d d)) (* (* w h) (* D D)))
10.0ms
(/ (* c0 (* d d)) (* (* w h) (* D D)))
10.0ms
(/ (* c0 (* d d)) (* (* w h) (* D D)))

series488.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
251.0ms
(+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))
101.0ms
(/ (* c0 (* d d)) (* (* w h) (* D D)))
75.0ms
(/ (* c0 (* d d)) (* (* w h) (* D D)))
61.0ms
(/ (* c0 (* d d)) (* (* w h) (* D D)))

simplify12.6s

Counts
43 → 90
Calls
43 calls:
Slowest
985.0ms
(+ (* (* c0 (* d d)) (sqrt (+ (* (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D))))) (+ (* (* M M) (* M M)) (* (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M)))))) (* (* (* w h) (* D D)) (sqrt (- (pow (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) 3) (pow (* M M) 3)))))
895.0ms
(/ (* (* (* c0 (* d d)) (* c0 (* d d))) (* c0 (* d d))) (* (* (* (* w h) (* D D)) (* (* w h) (* D D))) (* (* w h) (* D D))))
756.0ms
(* (* (* w h) (* D D)) (sqrt (+ (* (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D))))) (+ (* (* M M) (* M M)) (* (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))
666.0ms
(+ (* (* c0 (* d d)) (sqrt (+ (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M)))) (* (* (* w h) (* D D)) (sqrt (- (* (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (* M M) (* M M))))))
638.0ms
(/ (* (* (* c0 (* d d)) (* c0 (* d d))) (* c0 (* d d))) (* (* (* (* w h) (* D D)) (* (* w h) (* D D))) (* (* w h) (* D D))))

prune1.5s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 31.0b

localize6.0ms

Local error

Found 1 expressions with local error:

6.2b
(* (/ c0 (* 2 w)) 0)

rewrite9.0ms

Algorithm
rewrite-expression-head
Rules
associate-*l*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
div-inv
log1p-expm1-u
*-commutative
add-exp-log
associate-*l/
mul0
add-cbrt-cube
pow1
expm1-log1p-u
Counts
1 → 16
Calls
1 calls:
Slowest
9.0ms
(* (/ c0 (* 2 w)) 0)

series3.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
3.0ms
(* (/ c0 (* 2 w)) 0)

simplify8.0ms

Counts
6 → 19
Calls
6 calls:
Slowest
3.0ms
(* (cbrt (/ c0 (* 2 w))) (cbrt (/ c0 (* 2 w))))
2.0ms
(sqrt (/ c0 (* 2 w)))
1.0ms
(* c0 0)
0.0ms
0
0.0ms
0

prune305.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 29.4b

localize0.0ms

Local error

Found 0 expressions with local error:

rewrite0.0ms

Algorithm
rewrite-expression-head
Rules
Counts
0 → 0
Calls
0 calls:
Slowest

series0.0ms

Counts
0 → 0
Calls
0 calls:
Slowest

simplify0.0ms

Counts
0 → 0
Calls
0 calls:
Slowest

prune54.0ms

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 29.4b

localize67.0ms

Local error

Found 4 expressions with local error:

25.3b
(+ (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (sqrt (fma (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (- M) M))))
18.1b
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))
18.1b
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))
18.1b
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))

rewrite48.0ms

Algorithm
rewrite-expression-head
Rules
19×add-exp-log
19×add-cbrt-cube
19×pow1
15×associate-*l/
15×frac-times
12×associate-*r*
cbrt-unprod
associate-*r/
prod-exp
pow-prod-down
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
expm1-log1p-u
div-inv
*-commutative
associate-*l*
flip-+
flip3-+
fma-def
sum-log
+-commutative
Counts
4 → 98
Calls
4 calls:
Slowest
14.0ms
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))
13.0ms
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))
11.0ms
(+ (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (sqrt (fma (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (- M) M))))
9.0ms
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))

series427.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
259.0ms
(+ (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (sqrt (fma (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (- M) M))))
66.0ms
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))
53.0ms
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))
49.0ms
(* (* (/ d D) (/ d D)) (/ (/ c0 h) w))

simplify10.6s

Counts
74 → 110
Calls
74 calls:
Slowest
752.0ms
(/ (* c0 (pow d 2)) (* w (* (pow D 2) h)))
526.0ms
(* (exp (* (* (/ d D) (/ d D)) (/ (/ c0 h) w))) (exp (sqrt (fma (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (* (/ d D) (/ d D)) (/ (/ c0 h) w)) (* (- M) M)))))
463.0ms
(+ (+ (log (/ d D)) (log (/ d D))) (log (/ (/ c0 h) w)))
410.0ms
(/ (* c0 (pow d 2)) (* w (* (pow D 2) h)))
380.0ms
(+ (+ (log (/ d D)) (log (/ d D))) (log (/ (/ c0 h) w)))

prune2.1s

Pruning

9 alts after pruning (7 fresh and 2 done)

Merged error: 29.4b

regimes1.0s

Accuracy

0% (2.7b remaining)

Error of 33.7b against oracle of 31.0b and baseline of 33.7b

bsearch0.0ms

end0.0ms

sample21.0s

Algorithm
intervals
Results
25958×(pre true 80)
12968×(body nan 80)
6669×(body real 80)
2309×(body real 5120)
1748×(body real 2560)
883×(body real 1280)
547×(body exit 10240)
446×(body real 640)
271×(body real 320)
117×(body real 160)