Average Error: 0.2 → 0.0
Time: 20.1s
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(1 - a\right) \cdot \left(a \cdot a\right)\right) + (2 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) + \left({b}^{4} + {a}^{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 0 0.0

    \[\leadsto \left(\color{blue}{\left({b}^{4} + \left(2 \cdot \left({a}^{2} \cdot {b}^{2}\right) + {a}^{4}\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}{(2 \cdot \left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) + \left({a}^{4} + {b}^{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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019016 +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.7s)Debug log

sample259.0ms

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

simplify517.0ms

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

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize64.0ms

Local error

Found 4 expressions with local error:

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

rewrite37.0ms

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

series174.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
101.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a)))))
31.0ms
(* (* a a) (- 1 a))
21.0ms
(pow (+ (* a a) (* b b)) 2)
21.0ms
(* (* b b) (+ 3 a))

simplify3.0s

Counts
48 → 94
Calls
48 calls:
Slowest
489.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (- 1 a) (- 1 a)) (- 1 a)))
310.0ms
(- (+ (* 4 (pow a 2)) (* 12 (pow b 2))) (* 4 (pow a 3)))
306.0ms
(* (* (* b b) (+ 3 a)) 4)
266.0ms
(* 4 (* (* b b) (+ 3 a)))
147.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (+ 3 a) (+ 3 a)) (+ 3 a)))

prune1.4s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize29.0ms

Local error

Found 4 expressions with local error:

0.7b
(* (* b b) (+ 3 a))
0.2b
(* (* a b) (* a b))
0.1b
(* (* a a) (- 1 a))
0.0b
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a)))))

rewrite32.0ms

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

series125.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
67.0ms
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a)))))
22.0ms
(* (* a a) (- 1 a))
19.0ms
(* (* b b) (+ 3 a))
16.0ms
(* (* a b) (* a b))

simplify2.8s

Counts
46 → 93
Calls
46 calls:
Slowest
543.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
344.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (- 1 a) (- 1 a)) (- 1 a)))
292.0ms
(* (* (* b b) (+ 3 a)) 4)
250.0ms
(- (+ (* 4 (pow a 2)) (* 12 (pow b 2))) (* 4 (pow a 3)))
221.0ms
(* 4 (* (* b b) (+ 3 a)))

prune1.3s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 4 expressions with local error:

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

rewrite51.0ms

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

series175.0ms

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

simplify2.2s

Counts
45 → 90
Calls
45 calls:
Slowest
396.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (- 1 a) (- 1 a)) (- 1 a)))
253.0ms
(* (* b (* b (+ 3 a))) 4)
240.0ms
(- (+ (* 4 (pow a 2)) (* 12 (pow b 2))) (* 4 (pow a 3)))
229.0ms
(* 4 (* b (* b (+ 3 a))))
122.0ms
(* (exp (pow (+ (* a a) (* b b)) 2)) (exp (* 4 (+ (* (* a a) (- 1 a)) (* b (* b (+ 3 a)))))))

prune921.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

12.0b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
12.0b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
0.7b
(* (* b b) (+ 3 a))
0.2b
(fma (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))) (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a)))))

rewrite6.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
add-cube-cbrt
*-un-lft-identity
sqrt-prod
add-exp-log
add-cbrt-cube
pow1
add-log-exp
log1p-expm1-u
expm1-log1p-u
associate-*r*
associate-*r/
pow1/2
rem-sqrt-square
fma-udef
flip-+
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
associate-*l*
flip3-+
distribute-lft-in
distribute-rgt-in
Counts
4 → 59
Calls
4 calls:
Slowest
4.0ms
(* (* b b) (+ 3 a))
1.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
1.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
0.0ms
(fma (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))) (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a)))))

series229.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
122.0ms
(fma (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))) (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a)))))
44.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
44.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
18.0ms
(* (* b b) (+ 3 a))

simplify1.3s

Counts
30 → 71
Calls
30 calls:
Slowest
265.0ms
(- (+ (* 4 (pow a 2)) (* 12 (pow b 2))) (* 4 (pow a 3)))
100.0ms
(+ (pow b 4) (+ (pow a 4) (* 2 (* (pow a 2) (pow b 2)))))
91.0ms
(sqrt (* (cbrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))) (cbrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))))
91.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (+ 3 a) (+ 3 a)) (+ 3 a)))
84.0ms
(+ (pow b 4) (+ (pow a 4) (* 2 (* (pow a 2) (pow b 2)))))

prune1.1s

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0.0b

regimes84.0ms

Accuracy

0% (0.0b remaining)

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

bsearch3.0ms

end0.0ms

sample4.0s

Algorithm
intervals
Results
20583×(pre true 80)
20582×(body real 80)
(body real 160)