Average Error: 14.0 → 0.3
Time: 34.2s
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}}{\left(b - a\right) \cdot 2}}{a + b}\]

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.0

    \[\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 *-commutative0.3

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

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

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

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

Reproduce

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

sample106.0ms

Algorithm
intervals
Results
305×(pre true 80)
305×(body real 80)

simplify441.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
441.0ms
(* (* (/ PI 2) (/ 1 (- (* b b) (* a a)))) (- (/ 1 a) (/ 1 b)))

prune18.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize31.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))

rewrite42.0ms

Algorithm
rewrite-expression-head
Rules
78×*-un-lft-identity
72×times-frac
62×add-sqr-sqrt
46×add-cube-cbrt
43×div-inv
32×distribute-lft-out--
30×associate-*l*
20×add-exp-log
20×add-cbrt-cube
18×associate-*r*
12×associate-/l*
difference-of-squares
associate-/r/
add-log-exp
div-exp
associate-/r*
cbrt-undiv
pow1
associate-/l/
flip--
cbrt-unprod
prod-exp
flip3--
flip-+
frac-sub
flip3-+
frac-2neg
clear-num
*-commutative
associate-*r/
associate-*l/
pow-prod-down
div-sub
diff-log
sub-neg
frac-times
Counts
4 → 173
Calls
4 calls:
Slowest
14.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))
12.0ms
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
9.0ms
(/ (/ PI 2) (+ a b))
4.0ms
(- (/ 1 a) (/ 1 b))

series185.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
79.0ms
(/ (/ PI 2) (+ a b))
74.0ms
(* (/ (- (/ 1 a) (/ 1 b)) (- b a)) (/ (/ PI 2) (+ a b)))
23.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))
9.0ms
(- (/ 1 a) (/ 1 b))

simplify5.4s

Counts
176 → 185
Calls
176 calls:
Slowest
531.0ms
(+ (- (log (- (/ 1 a) (/ 1 b))) (log (- b a))) (- (log (/ PI 2)) (log (+ a b))))
373.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b)))
349.0ms
(+ (log (/ (- (/ 1 a) (/ 1 b)) (- b a))) (- (log (/ PI 2)) (log (+ a b))))
295.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))))
238.0ms
(+ (- (log (- (/ 1 a) (/ 1 b))) (log (- b a))) (log (/ (/ PI 2) (+ a b))))

prune1.8s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize4.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
(* (/ (/ PI 2) (+ a b)) (/ (- (/ 1 a) (/ 1 b)) (- b a)))
0.0b
(- (/ 1 a) (/ 1 b))

rewrite33.0ms

Algorithm
rewrite-expression-head
Rules
78×*-un-lft-identity
72×times-frac
62×add-sqr-sqrt
46×add-cube-cbrt
43×div-inv
32×distribute-lft-out--
30×associate-*r*
20×add-exp-log
20×add-cbrt-cube
18×associate-*l*
12×associate-/l*
difference-of-squares
associate-/r/
add-log-exp
div-exp
associate-/r*
cbrt-undiv
pow1
associate-/l/
flip--
cbrt-unprod
prod-exp
flip3--
flip-+
frac-sub
flip3-+
frac-2neg
clear-num
*-commutative
associate-*r/
associate-*l/
pow-prod-down
div-sub
diff-log
sub-neg
frac-times
Counts
4 → 173
Calls
4 calls:
Slowest
13.0ms
(* (/ (/ PI 2) (+ a b)) (/ (- (/ 1 a) (/ 1 b)) (- b a)))
10.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))
4.0ms
(- (/ 1 a) (/ 1 b))
4.0ms
(/ (/ PI 2) (+ a b))

series161.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
77.0ms
(* (/ (/ PI 2) (+ a b)) (/ (- (/ 1 a) (/ 1 b)) (- b a)))
54.0ms
(/ (/ PI 2) (+ a b))
22.0ms
(/ (- (/ 1 a) (/ 1 b)) (- b a))
8.0ms
(- (/ 1 a) (/ 1 b))

simplify5.5s

Counts
176 → 185
Calls
176 calls:
Slowest
364.0ms
(/ (* (cbrt (- (/ 1 a) (/ 1 b))) (cbrt (- (/ 1 a) (/ 1 b)))) (sqrt (- b a)))
347.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b)))
324.0ms
(/ (/ PI 2) (- (* a a) (* b b)))
222.0ms
(* (* (* (/ (/ PI 2) (+ a b)) (/ (/ PI 2) (+ a b))) (/ (/ PI 2) (+ a b))) (/ (* (* (- (/ 1 a) (/ 1 b)) (- (/ 1 a) (/ 1 b))) (- (/ 1 a) (/ 1 b))) (* (* (- b a) (- b a)) (- b a))))
213.0ms
(* (/ PI 2) (/ (- (/ 1 a) (/ 1 b)) (- b a)))

prune1.8s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0b

localize18.0ms

Local error

Found 4 expressions with local error:

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

rewrite35.0ms

Algorithm
rewrite-expression-head
Rules
66×times-frac
39×*-un-lft-identity
39×add-sqr-sqrt
27×add-cube-cbrt
20×div-inv
18×associate-/l*
12×distribute-lft-out--
12×associate-/r/
11×add-exp-log
11×add-cbrt-cube
10×associate-*r/
difference-of-squares
flip--
flip3--
associate-/l/
add-log-exp
div-exp
frac-2neg
associate-/r*
clear-num
cbrt-undiv
pow1
div-sub
flip-+
frac-sub
flip3-+
Counts
4 → 120
Calls
4 calls:
Slowest
21.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* 2 (- b a))) (+ a b))
10.0ms
(/ (- (/ PI a) (/ PI b)) (* 2 (- b a)))
0.0ms
(/ PI b)
0.0ms
(/ PI a)

series302.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
115.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* 2 (- b a))) (+ a b))
67.0ms
(/ PI b)
63.0ms
(/ PI a)
56.0ms
(/ (- (/ PI a) (/ PI b)) (* 2 (- b a)))

simplify9.5s

Counts
130 → 132
Calls
130 calls:
Slowest
404.0ms
(/ (- (/ PI a) (/ PI b)) (* 2 (- (* b b) (* a a))))
403.0ms
(- (- (log (- (/ PI a) (/ PI b))) (log (* 2 (- b a)))) (log (+ a b)))
350.0ms
(- (log (/ (- (/ PI a) (/ PI b)) (* 2 (- b a)))) (log (+ a b)))
322.0ms
(/ (/ (- (/ 1 a) (/ 1 b)) (- b a)) (+ a b))
319.0ms
(/ (/ (- (/ PI a) (/ PI b)) (* 2 (- (pow b 3) (pow a 3)))) (sqrt (+ a b)))

prune1.3s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0b

localize8.0ms

Local error

Found 3 expressions with local error:

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Rules
24×times-frac
21×add-cube-cbrt
21×*-un-lft-identity
21×add-sqr-sqrt
18×associate-*r*
16×add-exp-log
11×div-inv
10×add-cbrt-cube
pow1
associate-/l*
associate-/r/
prod-exp
associate-*l*
associate-/r*
add-log-exp
div-exp
rec-exp
flip-+
cbrt-unprod
flip3-+
frac-2neg
clear-num
cbrt-undiv
associate-/l/
inv-pow
pow-flip
*-commutative
associate-*r/
associate-*l/
pow-prod-down
frac-times
Counts
3 → 88
Calls
3 calls:
Slowest
9.0ms
(* (/ 1 (* a b)) (/ (/ PI 2) (+ a b)))
3.0ms
(/ (/ PI 2) (+ a b))
1.0ms
(/ 1 (* a b))

series181.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
90.0ms
(* (/ 1 (* a b)) (/ (/ PI 2) (+ a b)))
78.0ms
(/ (/ PI 2) (+ a b))
13.0ms
(/ 1 (* a b))

simplify2.7s

Counts
74 → 97
Calls
74 calls:
Slowest
431.0ms
(+ (log (/ 1 (* a b))) (- (log (/ PI 2)) (log (+ a b))))
399.0ms
(/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b)))
352.0ms
(+ (- (log (* a b))) (- (log (/ PI 2)) (log (+ a b))))
256.0ms
(+ (log (/ 1 (* a b))) (log (/ (/ PI 2) (+ a b))))
251.0ms
(* (* (* (/ 1 (* a b)) (/ 1 (* a b))) (/ 1 (* a b))) (/ (* (* (/ PI 2) (/ PI 2)) (/ PI 2)) (* (* (+ a b) (+ a b)) (+ a b))))

prune935.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

regimes150.0ms

Accuracy

0% (0.3b remaining)

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

bsearch3.0ms

end0.0ms

sample2.9s

Algorithm
intervals
Results
9556×(pre true 80)
9556×(body real 80)