Average Error: 14.1 → 0.2
Time: 28.8s
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}{2}}{b + a}}{b \cdot 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. Taylor expanded around inf 0.3

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

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

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

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

Reproduce

herbie shell --seed 2019005 
(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

sample98.0ms

Algorithm
intervals

simplify316.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune26.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.2b

localize45.0ms

Local error

Found 4 expressions with local error:

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

rewrite59.0ms

Algorithm
rewrite-expression-head
Counts
4 → 173
Calls

4 calls. Slowest were:

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

series185.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

82.0ms
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
67.0ms
(/ (/ PI 2) (+ a b))
28.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))
8.0ms
(- (/ 1 a) (/ 1 b))

simplify5.9s

Counts
176 → 185
Calls

176 calls. Slowest were:

853.0ms
(+ (- (log (- (/ 1 a) (/ 1 b))) (log (- b a))) (- (log (/ PI 2)) (log (+ a b))))
335.0ms
(+ (log (/ (- (/ 1 a) (/ 1 b)) (- b a))) (- (log (/ PI 2)) (log (+ a b))))
335.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b)))

prune1.8s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize8.0ms

Local error

Found 3 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
3 → 88
Calls

3 calls. Slowest were:

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

series136.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

78.0ms
(* (/ 1 (* a b)) (/ (/ PI 2) (+ a b)))
51.0ms
(/ (/ PI 2) (+ a b))
8.0ms
(/ 1 (* a b))

simplify2.6s

Counts
74 → 97
Calls

74 calls. Slowest were:

494.0ms
(+ (log (/ 1 (* a b))) (- (log (/ PI 2)) (log (+ a b))))
345.0ms
(+ (- (log (* a b))) (- (log (/ PI 2)) (log (+ a b))))
299.0ms
(+ (log (/ 1 (* a b))) (log (/ (/ PI 2) (+ a b))))

prune794.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0b

localize16.0ms

Local error

Found 2 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
2 → 86
Calls

2 calls. Slowest were:

13.0ms
(/ (/ (/ PI 2) (+ b a)) (* a b))
6.0ms
(/ (/ PI 2) (+ b a))

series163.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

99.0ms
(/ (/ (/ PI 2) (+ b a)) (* a b))
64.0ms
(/ (/ PI 2) (+ b a))

simplify3.0s

Counts
97 → 92
Calls

97 calls. Slowest were:

400.0ms
(- (- (log (/ PI 2)) (log (+ b a))) (log (* a b)))
379.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ b a) (+ b a)) (+ b a)))
336.0ms
(/ (/ PI 2) (- (* b b) (* a a)))

prune838.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

localize32.0ms

Local error

Found 4 expressions with local error:

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

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 120
Calls

4 calls. Slowest were:

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

series294.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (- b a))
90.0ms
(/ (- (/ PI a) (/ PI b)) (* (+ a b) 2))
46.0ms
(/ PI b)
43.0ms
(/ PI a)

simplify7.9s

Counts
129 → 132
Calls

129 calls. Slowest were:

318.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (cbrt (- b a)))
311.0ms
(/ (- (/ PI a) (/ PI b)) (* (- (* a a) (* b b)) 2))
287.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* (+ a b) 2)) (sqrt (- b a)))

prune1.3s

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

regimes123.0ms

Accuracy

0% (0.2b remaining)

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

bsearch1.0ms

end0.0ms

sample2.6s

Algorithm
intervals