Average Error: 14.1 → 0.3
Time: 1.0m
Precision: 64
Internal Precision: 128
\[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)\]
\[\frac{\frac{\frac{\pi}{a} - \frac{\pi}{b}}{2 \cdot \left(a + b\right)}}{b - a}\]

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.1

    \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)\]
  2. Simplified0.3

    \[\leadsto \color{blue}{\frac{\frac{1}{a} - \frac{1}{b}}{b - a} \cdot \frac{\frac{\pi}{2}}{a + b}}\]
  3. Using strategy rm
  4. Applied associate-*l/0.3

    \[\leadsto \color{blue}{\frac{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\frac{\pi}{2}}{a + b}}{b - a}}\]
  5. Simplified0.3

    \[\leadsto \frac{\color{blue}{\frac{\frac{\pi}{a} - \frac{\pi}{b}}{\left(a + b\right) \cdot 2}}}{b - a}\]
  6. Final simplification0.3

    \[\leadsto \frac{\frac{\frac{\pi}{a} - \frac{\pi}{b}}{2 \cdot \left(a + b\right)}}{b - a}\]

Reproduce

herbie shell --seed 2019002 
(FPCore (a b)
  :name "NMSE Section 6.1 mentioned, B"
  (* (* (/ PI 2) (/ 1 (- (* b b) (* a a)))) (- (/ 1 a) (/ 1 b))))

Details

Time bar (total: 1.0m)Debug log

sample116.0ms

Algorithm
intervals

simplify402.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

402.0ms
(* (* (/ PI 2) (/ 1 (- (* b b) (* a a)))) (- (/ 1 a) (/ 1 b)))

prune22.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.2b

localize29.0ms

Local error

Found 3 expressions with local error:

0.3b
(/ (/ PI 2) (+ a b))
0.3b
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
0.3b
(/ (- (/ 1 a) (/ 1 b)) (- b a))

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
3 → 155
Calls

3 calls. Slowest were:

16.0ms
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
9.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))
3.0ms
(/ (/ PI 2) (+ a b))

series189.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

109.0ms
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
63.0ms
(/ (/ PI 2) (+ a b))
17.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))

simplify5.8s

Counts
164 → 164
Calls

164 calls. Slowest were:

548.0ms
(+ (log (/ (- (/ 1 a) (/ 1 b)) (- b a))) (log (/ (/ PI 2) (+ a b))))
536.0ms
(+ (- (log (- (/ 1 a) (/ 1 b))) (log (- b a))) (- (log (/ PI 2)) (log (+ a b))))
469.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b)))

prune1.7s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0b

localize31.0ms

Local error

Found 4 expressions with local error:

0.3b
(/ PI b)
0.3b
(/ (- (/ PI a) (/ PI b)) (* (+ a b) 2))
0.3b
(/ PI a)
0.2b
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (- b a))

rewrite53.0ms

Algorithm
rewrite-expression-head
Counts
4 → 120
Calls

4 calls. Slowest were:

29.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (- b a))
20.0ms
(/ (- (/ PI a) (/ PI b)) (* (+ a b) 2))
0.0ms
(/ PI b)

series340.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

110.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (- b a))
106.0ms
(/ (- (/ PI a) (/ PI b)) (* (+ a b) 2))
64.0ms
(/ PI b)
60.0ms
(/ PI a)

simplify8.5s

Counts
129 → 132
Calls

129 calls. Slowest were:

371.0ms
(/ (- (/ PI a) (/ PI b)) (* (- (* a a) (* b b)) 2))
359.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (cbrt (- b a)))
326.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (sqrt (- b a)))

prune1.2s

Pruning

9 alts after pruning (7 fresh and 2 done)

Merged error: 0b

localize20.0ms

Local error

Found 4 expressions with local error:

0.3b
(/ PI b)
0.3b
(/ PI a)
0.2b
(/ (/ 1 (+ a b)) (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))
0.2b
(/ (- b a) (/ (- (/ PI a) (/ PI b)) 2))

rewrite36.0ms

Algorithm
rewrite-expression-head
Counts
4 → 198
Calls

4 calls. Slowest were:

17.0ms
(/ (/ 1 (+ a b)) (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))
12.0ms
(/ (- b a) (/ (- (/ PI a) (/ PI b)) 2))
0.0ms
(/ PI b)

series310.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(/ (/ 1 (+ a b)) (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))
87.0ms
(/ (- b a) (/ (- (/ PI a) (/ PI b)) 2))
57.0ms
(/ PI a)
51.0ms
(/ PI b)

simplify32.6s

Counts
278 → 210
Calls

278 calls. Slowest were:

714.0ms
(/ (/ 1 (+ (pow a 3) (pow b 3))) (/ (sqrt (- b a)) (sqrt (/ (- (/ PI a) (/ PI b)) 2))))
473.0ms
(/ (/ 1 (+ (pow a 3) (pow b 3))) (/ (- b a) (- (/ PI a) (/ PI b))))
451.0ms
(/ (/ 1 (- (* a a) (* b b))) (/ 1 (sqrt (/ (- (/ PI a) (/ PI b)) 2))))

prune2.1s

Pruning

8 alts after pruning (6 fresh and 2 done)

Merged error: 0b

localize12.0ms

Local error

Found 4 expressions with local error:

0.4b
(/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))
0.3b
(/ PI b)
0.3b
(/ PI a)
0.2b
(* (/ 1 (+ a b)) (/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2))))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
4 → 85
Calls

4 calls. Slowest were:

14.0ms
(* (/ 1 (+ a b)) (/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2))))
6.0ms
(/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))
0.0ms
(/ PI a)

series285.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(* (/ 1 (+ a b)) (/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2))))
66.0ms
(/ PI a)
59.0ms
(/ PI b)
45.0ms
(/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))

simplify4.8s

Counts
55 → 97
Calls

55 calls. Slowest were:

396.0ms
(+ (log (/ 1 (+ a b))) (log (/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))))
303.0ms
(+ (- (log (+ a b))) (- (- (log (- b a)) (log (/ (- (/ PI a) (/ PI b)) 2)))))
286.0ms
(+ (- (log (+ a b))) (log (/ 1 (/ (- b a) (/ (- (/ PI a) (/ PI b)) 2)))))

prune994.0ms

Pruning

8 alts after pruning (5 fresh and 3 done)

Merged error: 0b

regimes92.0ms

Accuracy

0% (0.2b remaining)

Error of 0.3b against oracle of 0.0b and baseline of 0.3b

bsearch2.0ms

end0.0ms

sample2.5s

Algorithm
intervals