Average Error: 0.2 → 0.0
Time: 19.7s
Precision: 64
Internal Precision: 128
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right) - 1\]
\[\left(4 \cdot \left(\left(b \cdot b\right) \cdot \left(3 + a\right) + \left(\left(1 - a\right) \cdot a\right) \cdot a\right) + (\left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) \cdot 2 + \left({a}^{4} + {b}^{4}\right))_*\right) - 1\]

Error

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 0.2

    \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right) - 1\]
  2. Taylor expanded around inf 0.0

    \[\leadsto \left(\color{blue}{\left({b}^{4} + \left({a}^{4} + 2 \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)\right)} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right) - 1\]
  3. Simplified0.0

    \[\leadsto \left(\color{blue}{(\left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) \cdot 2 + \left({b}^{4} + {a}^{4}\right))_*} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right) - 1\]
  4. Using strategy rm
  5. Applied associate-*l*0.0

    \[\leadsto \left((\left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) \cdot 2 + \left({b}^{4} + {a}^{4}\right))_* + 4 \cdot \left(\color{blue}{a \cdot \left(a \cdot \left(1 - a\right)\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right) - 1\]
  6. Final simplification0.0

    \[\leadsto \left(4 \cdot \left(\left(b \cdot b\right) \cdot \left(3 + a\right) + \left(\left(1 - a\right) \cdot a\right) \cdot a\right) + (\left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) \cdot 2 + \left({a}^{4} + {b}^{4}\right))_*\right) - 1\]

Reproduce

herbie shell --seed 2019010 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (24)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))) 1))

Details

Time bar (total: 19.5s)Debug log

sample239.0ms

Algorithm
intervals

simplify163.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
162.0ms
(- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))) 1)

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize33.0ms

Local error

Found 4 expressions with local error:

1.1b
(* (* b b) (+ 3 a))
0.3b
(pow (+ (* a a) (* b b)) 2)
0.1b
(* (* a a) (- 1 a))
0.0b
(* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))

rewrite34.0ms

Algorithm
rewrite-expression-head
Rules
18×associate-*r/
add-exp-log
associate-*r*
pow1
add-cube-cbrt
add-cbrt-cube
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
flip-+
frac-add
flip3-+
distribute-lft-in
expm1-log1p-u
distribute-rgt-in
flip--
*-commutative
flip3--
unpow-prod-down
cbrt-unprod
prod-exp
pow-prod-down
associate-*l*
sub-neg
unpow2
pow-exp
pow-pow
pow-to-exp
Counts
4 → 81
Calls
4 calls:
Slowest
16.0ms
(* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))
8.0ms
(* (* a a) (- 1 a))
5.0ms
(pow (+ (* a a) (* b b)) 2)
4.0ms
(* (* b b) (+ 3 a))

series124.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
50.0ms
(* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))
32.0ms
(* (* a a) (- 1 a))
23.0ms
(* (* b b) (+ 3 a))
20.0ms
(pow (+ (* a a) (* b b)) 2)

simplify4.6s

Counts
50 → 93
Calls
50 calls:
Slowest
790.0ms
(* (+ (* 1 1) (+ (* a a) (* 1 a))) (+ (* 3 3) (- (* a a) (* 3 a))))
482.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (- 1 a) (- 1 a)) (- 1 a)))
336.0ms
(* (+ 1 a) (+ (* 3 3) (- (* a a) (* 3 a))))
281.0ms
(* (* (* b b) (+ 3 a)) 4)
261.0ms
(* 4 (* (* b b) (+ 3 a)))

prune903.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize23.0ms

Local error

Found 4 expressions with local error:

1.1b
(* (* b b) (+ 3 a))
0.2b
(* (* a b) (* a b))
0.1b
(* (* a a) (- 1 a))
0.0b
(* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))

rewrite23.0ms

Algorithm
rewrite-expression-head
Rules
18×associate-*r/
13×pow1
10×add-exp-log
10×associate-*r*
10×add-cbrt-cube
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
flip-+
*-commutative
frac-add
flip3-+
distribute-lft-in
expm1-log1p-u
distribute-rgt-in
flip--
cbrt-unprod
prod-exp
pow-prod-down
associate-*l*
flip3--
sub-neg
pow-prod-up
pow-plus
pow2
Counts
4 → 83
Calls
4 calls:
Slowest
11.0ms
(* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))
4.0ms
(* (* a a) (- 1 a))
4.0ms
(* (* b b) (+ 3 a))
4.0ms
(* (* a b) (* a b))

series90.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
29.0ms
(* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))
22.0ms
(* (* a a) (- 1 a))
22.0ms
(* (* b b) (+ 3 a))
16.0ms
(* (* a b) (* a b))

simplify3.7s

Counts
51 → 95
Calls
51 calls:
Slowest
423.0ms
(* (+ (* 1 1) (+ (* a a) (* 1 a))) (+ (* 3 3) (- (* a a) (* 3 a))))
413.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
334.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (- 1 a) (- 1 a)) (- 1 a)))
287.0ms
(* (+ 1 a) (+ (* 3 3) (- (* a a) (* 3 a))))
227.0ms
(* (* (* b b) (+ 3 a)) 4)

prune1.1s

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

1.1b
(* (* b b) (+ 3 a))
0.2b
(* (* a b) (* a b))
0.1b
(* a (* a (- 1 a)))
0.0b
(* 4 (+ (* a (* a (- 1 a))) (* (* b b) (+ 3 a))))

rewrite22.0ms

Algorithm
rewrite-expression-head
Rules
24×associate-*r/
11×pow1
10×distribute-lft-in
10×distribute-rgt-in
add-exp-log
associate-*r*
add-cbrt-cube
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
flip-+
*-commutative
frac-add
flip3-+
sub-neg
expm1-log1p-u
flip--
flip3--
cbrt-unprod
prod-exp
pow-prod-down
associate-*l*
pow-prod-up
pow-plus
pow2
Counts
4 → 81
Calls
4 calls:
Slowest
9.0ms
(* 4 (+ (* a (* a (- 1 a))) (* (* b b) (+ 3 a))))
6.0ms
(* (* b b) (+ 3 a))
4.0ms
(* (* a b) (* a b))
3.0ms
(* a (* a (- 1 a)))

series87.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
30.0ms
(* 4 (+ (* a (* a (- 1 a))) (* (* b b) (+ 3 a))))
22.0ms
(* a (* a (- 1 a)))
18.0ms
(* (* b b) (+ 3 a))
16.0ms
(* (* a b) (* a b))

simplify3.5s

Counts
50 → 93
Calls
50 calls:
Slowest
420.0ms
(* (+ (* 1 1) (+ (* a a) (* 1 a))) (+ (* 3 3) (- (* a a) (* 3 a))))
416.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
253.0ms
(* (+ 1 a) (+ (* 3 3) (- (* a a) (* 3 a))))
239.0ms
(+ (* a (* a (- 1 a))) (* (* b b) (+ 3 a)))
226.0ms
(sqrt (+ (* a (* a (- 1 a))) (* (* b b) (+ 3 a))))

prune1.1s

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample3.8s

Algorithm
intervals