Average Error: 0.2 → 0.0
Time: 23.5s
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(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\left((2 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) + \left({b}^{4} + {a}^{4}\right))_* + 4 \cdot \left(\left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right) + \left(1 + a\right) \cdot \left(a \cdot a\right)\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(1 - 3 \cdot 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(1 - 3 \cdot 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(1 - 3 \cdot a\right)\right)\right) - 1\]
  4. Final simplification0.0

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

Reproduce

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

Details

Time bar (total: 22.8s)Debug log

sample141.0ms

Algorithm
intervals
Results
114.0ms661×body80valid

simplify218.0ms

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

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize45.0ms

Local error

Found 4 expressions with local error:

0.8b
(* (* b b) (- 1 (* 3 a)))
0.4b
(pow (+ (* a a) (* b b)) 2)
0.1b
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
0.1b
(* (* a a) (+ 1 a))

rewrite42.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
28.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
6.0ms
(* (* a a) (+ 1 a))
4.0ms
(* (* b b) (- 1 (* 3 a)))
3.0ms
(pow (+ (* a a) (* b b)) 2)

series148.0ms

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

simplify5.0s

Counts
48 → 94
Calls
48 calls:
Slowest
800.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
690.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
438.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
326.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)
265.0ms
(* (* b b) (- 1 (* 3 a)))

prune1.2s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize52.0ms

Local error

Found 4 expressions with local error:

0.8b
(* (* b b) (- 1 (* 3 a)))
0.1b
(* (* a b) (* a b))
0.1b
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
0.1b
(* (* a a) (+ 1 a))

rewrite23.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
8.0ms
(* (* b b) (- 1 (* 3 a)))
6.0ms
(* (* a b) (* a b))
5.0ms
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
3.0ms
(* (* a a) (+ 1 a))

series164.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
76.0ms
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
36.0ms
(* (* a a) (+ 1 a))
26.0ms
(* (* b b) (- 1 (* 3 a)))
26.0ms
(* (* a b) (* a b))

simplify4.9s

Counts
46 → 93
Calls
46 calls:
Slowest
799.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
665.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
591.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
366.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
313.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)

prune1.3s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 4 expressions with local error:

9.3b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
9.3b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
0.8b
(* (* b b) (- 1 (* 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) (- 1 (* 3 a))))))

rewrite8.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
distribute-lft-in
sub-neg
rem-sqrt-square
distribute-rgt-in
flip--
fma-udef
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
associate-*l*
flip3--
Counts
4 → 61
Calls
4 calls:
Slowest
4.0ms
(* (* b b) (- 1 (* 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) (- 1 (* 3 a))))))

series231.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
121.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) (- 1 (* 3 a))))))
43.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
43.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
23.0ms
(* (* b b) (- 1 (* 3 a)))

simplify2.4s

Counts
32 → 73
Calls
32 calls:
Slowest
535.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
235.0ms
(* (* b b) (- 1 (* 3 a)))
157.0ms
(+ (* 4 (pow a 2)) (+ (* 4 (pow b 2)) (* 4 (pow a 3))))
142.0ms
(+ (* 1 1) (+ (* (* 3 a) (* 3 a)) (* 1 (* 3 a))))
110.0ms
(- (pow b 2) (* 3 (* a (pow b 2))))

prune879.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize14.0ms

Local error

Found 4 expressions with local error:

10.6b
(sqrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))
10.6b
(sqrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))
9.3b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
9.3b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))

rewrite5.0ms

Algorithm
rewrite-expression-head
Rules
26×sqrt-prod
16×add-sqr-sqrt
10×add-cube-cbrt
10×*-un-lft-identity
rem-sqrt-square
add-log-exp
log1p-expm1-u
add-exp-log
pow1/2
add-cbrt-cube
pow1
expm1-log1p-u
Counts
4 → 64
Calls
4 calls:
Slowest
1.0ms
(sqrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))
1.0ms
(sqrt (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))))
1.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))

series197.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
65.0ms
(sqrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))
58.0ms
(sqrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))
38.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
36.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))

simplify1.1s

Counts
36 → 76
Calls
36 calls:
Slowest
62.0ms
(sqrt (* (cbrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))) (cbrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))))
62.0ms
(sqrt (sqrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))))
62.0ms
(sqrt (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)))))))
62.0ms
(sqrt (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)))))))
61.0ms
(sqrt (* (cbrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))) (cbrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))))

prune1.0s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.0b

regimes75.0ms

Accuracy

0% (0.0b remaining)

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

bsearch3.0ms

end0.0ms

sample3.5s

Algorithm
intervals
Results
3.3s20530×body80valid