Average Error: 14.3 → 0.3
Time: 33.9s
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{1}{a + b} \cdot \frac{\frac{\frac{\pi}{a} - \frac{\pi}{b}}{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.3

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

    \[\leadsto \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. Using strategy rm
  7. Applied *-un-lft-identity0.3

    \[\leadsto \frac{\frac{\frac{\pi}{a} - \frac{\pi}{b}}{\left(a + b\right) \cdot 2}}{\color{blue}{1 \cdot \left(b - a\right)}}\]
  8. Applied *-un-lft-identity0.3

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

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

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

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

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

Reproduce

herbie shell --seed 2018360 
(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: 28.3s)Debug log

start143.0ms

Algorithm
intervals

setup317.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.2b

localize47.0ms

Local error

Found 3 expressions with local error:

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

rewrite53.0ms

Algorithm
rewrite-expression-head
Counts
3 → 155
Calls

3 calls. Slowest were:

24.0ms
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
18.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))
7.0ms
(/ (/ PI 2) (+ a b))

series229.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

109.0ms
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
91.0ms
(/ (/ PI 2) (+ a b))
28.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))

simplify5.3s

Counts
164 → 164
Calls

164 calls. Slowest were:

380.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b)))
342.0ms
(+ (- (log (- (/ 1 a) (/ 1 b))) (log (- b a))) (- (log (/ PI 2)) (log (+ a b))))
297.0ms
(* (/ (* (* (- (/ 1 a) (/ 1 b)) (- (/ 1 a) (/ 1 b))) (- (/ 1 a) (/ 1 b))) (* (* (- b a) (- b a)) (- b a))) (/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b))))

prune2.4s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize8.0ms

Local error

Found 3 expressions with local error:

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

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
3 → 88
Calls

3 calls. Slowest were:

16.0ms
(* (/ 1 (* a b)) (/ (/ PI 2) (+ a b)))
6.0ms
(/ (/ PI 2) (+ a b))
1.0ms
(/ 1 (* a b))

series153.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

79.0ms
(* (/ 1 (* a b)) (/ (/ PI 2) (+ a b)))
61.0ms
(/ (/ PI 2) (+ a b))
13.0ms
(/ 1 (* a b))

simplify2.5s

Counts
74 → 97
Calls

74 calls. Slowest were:

342.0ms
(+ (log (/ 1 (* a b))) (- (log (/ PI 2)) (log (+ a b))))
327.0ms
(+ (- (log (* a b))) (- (log (/ PI 2)) (log (+ a b))))
309.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b)))

prune1.2s

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0b

localize31.0ms

Local error

Found 4 expressions with local error:

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

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 120
Calls

4 calls. Slowest were:

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

series294.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

103.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (- b a))
88.0ms
(/ (- (/ PI a) (/ PI b)) (* (+ a b) 2))
59.0ms
(/ PI a)
44.0ms
(/ PI b)

simplify7.9s

Counts
129 → 132
Calls

129 calls. Slowest were:

339.0ms
(/ (- (/ PI a) (/ PI b)) (* (- (* a a) (* b b)) 2))
272.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (- (* a a) (* b b)) 2)) (* (cbrt (- b a)) (cbrt (- b a))))
264.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ (pow a 3) (pow b 3)) 2)) 1)

prune1.4s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0b

localize11.0ms

Local error

Found 4 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 97
Calls

4 calls. Slowest were:

10.0ms
(* (/ 1 (+ a b)) (/ (/ (- (/ PI a) (/ PI b)) 2) (- b a)))
9.0ms
(/ (/ (- (/ PI a) (/ PI b)) 2) (- b a))
0.0ms
(/ PI b)

series227.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

96.0ms
(* (/ 1 (+ a b)) (/ (/ (- (/ PI a) (/ PI b)) 2) (- b a)))
51.0ms
(/ (/ (- (/ PI a) (/ PI b)) 2) (- b a))
42.0ms
(/ PI b)
38.0ms
(/ PI a)

simplify4.7s

Counts
81 → 109
Calls

81 calls. Slowest were:

407.0ms
(* (/ 1 (+ a b)) (/ (/ (- (/ PI a) (/ PI b)) 2) (- b a)))
391.0ms
(+ (log (/ 1 (+ a b))) (log (/ (/ (- (/ PI a) (/ PI b)) 2) (- b a))))
376.0ms
(+ (log (/ 1 (+ a b))) (- (log (/ (- (/ PI a) (/ PI b)) 2)) (log (- b a))))

prune1.2s

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

regimes131.0ms

Accuracy

0% (0.3b remaining)

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

bsearch2.0ms