Average Error: 14.5 → 0.2
Time: 41.4s
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{\pi}{a \cdot b} \cdot \frac{1}{2}}{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.5

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

    \[\leadsto \color{blue}{\frac{(\left(\frac{\pi}{2}\right) \cdot \left(\frac{-1}{b}\right) + \left(\frac{\frac{\pi}{2}}{a}\right))_*}{\left(a + b\right) \cdot \left(b - a\right)}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity9.6

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

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

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

    \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{\pi}{a \cdot 2} - \frac{\pi}{2 \cdot b}}{b - a}}{a + b}}\]
  9. Simplified0.3

    \[\leadsto \frac{\color{blue}{\frac{\frac{\pi}{a} \cdot \frac{1}{2} - \frac{\frac{\pi}{b}}{2}}{b - a}}}{a + b}\]
  10. Taylor expanded around inf 0.2

    \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{\pi}{a \cdot b}}}{a + b}\]
  11. Final simplification0.2

    \[\leadsto \frac{\frac{\pi}{a \cdot b} \cdot \frac{1}{2}}{b + a}\]

Reproduce

herbie shell --seed 2019007 +o rules:numerics
(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: 40.5s)Debug log

sample94.0ms

Algorithm
intervals

simplify333.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune29.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 9.6b

localize47.0ms

Local error

Found 3 expressions with local error:

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

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
3 → 58
Calls

3 calls. Slowest were:

12.0ms
(/ (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (* (+ a b) (- b a)))
5.0ms
(/ (/ PI 2) a)
0.0ms
(fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))

series276.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

128.0ms
(/ (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (* (+ a b) (- b a)))
95.0ms
(/ (/ PI 2) a)
54.0ms
(fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))

simplify2.1s

Counts
32 → 67
Calls

32 calls. Slowest were:

382.0ms
(* (+ (* a a) (- (* b b) (* a b))) (+ (* b b) (+ (* a a) (* b a))))
240.0ms
(- (log (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))) (log (* (+ a b) (- b a))))
181.0ms
(/ (* (* (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))) (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))) (* (* (* (+ a b) (+ a b)) (+ a b)) (* (* (- b a) (- b a)) (- b a))))

prune794.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize6.0ms

Local error

Found 4 expressions with local error:

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

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 140
Calls

4 calls. Slowest were:

6.0ms
(/ (/ (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (+ a b)) (- b a))
3.0ms
(/ (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (+ a b))
3.0ms
(/ (/ PI 2) a)

series378.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

116.0ms
(/ (/ (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (+ a b)) (- b a))
111.0ms
(/ (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (+ a b))
94.0ms
(/ (/ PI 2) a)
56.0ms
(fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))

simplify10.3s

Counts
155 → 152
Calls

155 calls. Slowest were:

475.0ms
(/ (/ (sqrt (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))) (sqrt (+ a b))) (cbrt (- b a)))
425.0ms
(/ (/ (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)) (- (* a a) (* b b))) (* (cbrt (- b a)) (cbrt (- b a))))
353.0ms
(/ (/ (* (cbrt (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a))) (cbrt (fma (/ PI 2) (/ -1 b) (/ (/ PI 2) a)))) (* (cbrt (+ a b)) (cbrt (+ a b)))) (* (cbrt (- b a)) (cbrt (- b a))))

prune1.6s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0b

localize41.0ms

Local error

Found 4 expressions with local error:

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

rewrite41.0ms

Algorithm
rewrite-expression-head
Counts
4 → 123
Calls

4 calls. Slowest were:

27.0ms
(/ (- (/ PI (* a 2)) (/ PI (* 2 b))) (- b a))
12.0ms
(* (/ 1 (+ a b)) (/ (- (/ PI (* a 2)) (/ PI (* 2 b))) (- b a)))
1.0ms
(/ PI (* a 2))

series308.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

109.0ms
(* (/ 1 (+ a b)) (/ (- (/ PI (* a 2)) (/ PI (* 2 b))) (- b a)))
76.0ms
(/ (- (/ PI (* a 2)) (/ PI (* 2 b))) (- b a))
65.0ms
(/ PI (* 2 b))
59.0ms
(/ PI (* a 2))

simplify5.2s

Counts
101 → 135
Calls

101 calls. Slowest were:

369.0ms
(- (pow (/ PI (* a 2)) 3) (pow (/ PI (* 2 b)) 3))
315.0ms
(/ (* (* (- (/ PI (* a 2)) (/ PI (* 2 b))) (- (/ PI (* a 2)) (/ PI (* 2 b)))) (- (/ PI (* a 2)) (/ PI (* 2 b)))) (* (* (- b a) (- b a)) (- b a)))
208.0ms
(* 1 (/ (- (/ PI (* a 2)) (/ PI (* 2 b))) (- b a)))

prune1.6s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

localize22.0ms

Local error

Found 4 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 142
Calls

4 calls. Slowest were:

15.0ms
(/ (- (* (/ PI a) 1/2) (/ (/ PI b) 2)) (- b a))
11.0ms
(/ (/ (- (* (/ PI a) 1/2) (/ (/ PI b) 2)) (- b a)) (+ a b))
0.0ms
(/ PI a)

series299.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

100.0ms
(/ (/ (- (* (/ PI a) 1/2) (/ (/ PI b) 2)) (- b a)) (+ a b))
92.0ms
(/ (- (* (/ PI a) 1/2) (/ (/ PI b) 2)) (- b a))
62.0ms
(/ PI a)
46.0ms
(/ PI b)

simplify12.6s

Counts
158 → 154
Calls

158 calls. Slowest were:

431.0ms
(/ (- (* (/ PI a) 1/2) (/ (/ PI b) 2)) (- (* b b) (* a a)))
311.0ms
(/ (/ (- (* (/ PI a) 1/2) (/ (/ PI b) 2)) (sqrt (- b a))) (sqrt (+ a b)))
289.0ms
(/ (* (* (- (* (/ PI a) 1/2) (/ (/ PI b) 2)) (- (* (/ PI a) 1/2) (/ (/ PI b) 2))) (- (* (/ PI a) 1/2) (/ (/ PI b) 2))) (* (* (- b a) (- b a)) (- b a)))

prune1.7s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0b

regimes110.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms

end0.0ms

sample2.6s

Algorithm
intervals