Average Error: 0.2 → 0.0
Time: 30.0s
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 2019010 +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: 29.6s)Debug log

sample193.0ms

Algorithm
intervals

simplify254.0ms

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

prune18.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize71.0ms

Local error

Found 4 expressions with local error:

1.0b
(* (* b b) (- 1 (* 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) (- 1 (* 3 a))))))

rewrite45.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
23.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
8.0ms
(* (* b b) (- 1 (* 3 a)))
7.0ms
(* (* a a) (+ 1 a))
5.0ms
(pow (+ (* a a) (* b b)) 2)

series154.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
72.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
35.0ms
(* (* a a) (+ 1 a))
24.0ms
(pow (+ (* a a) (* b b)) 2)
23.0ms
(* (* b b) (- 1 (* 3 a)))

simplify5.8s

Counts
48 → 94
Calls
48 calls:
Slowest
981.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
689.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
471.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
448.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)
319.0ms
(* (* b b) (- 1 (* 3 a)))

prune1.6s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize31.0ms

Local error

Found 4 expressions with local error:

1.0b
(* (* b b) (- 1 (* 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) (- 1 (* 3 a))))))

rewrite34.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) (- 1 (* 3 a))))))
9.0ms
(* (* b b) (- 1 (* 3 a)))
7.0ms
(* (* a b) (* a b))
7.0ms
(* (* a a) (+ 1 a))

series167.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
62.0ms
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
39.0ms
(* (* b b) (- 1 (* 3 a)))
39.0ms
(* (* a a) (+ 1 a))
27.0ms
(* (* a b) (* a b))

simplify6.1s

Counts
46 → 93
Calls
46 calls:
Slowest
1.1s
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
697.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
672.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
376.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
364.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)

prune1.4s

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize14.0ms

Local error

Found 4 expressions with local error:

12.6b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
12.6b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
1.0b
(* (* 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))))))

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

series261.0ms

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

simplify3.2s

Counts
32 → 73
Calls
32 calls:
Slowest
522.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
300.0ms
(* (* b b) (- 1 (* 3 a)))
269.0ms
(+ (* 1 1) (+ (* (* 3 a) (* 3 a)) (* 1 (* 3 a))))
239.0ms
(+ (* 4 (pow a 2)) (+ (* 4 (pow b 2)) (* 4 (pow a 3))))
203.0ms
(- (pow b 2) (* 3 (* a (pow b 2))))

prune1.4s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0.0b

localize39.0ms

Local error

Found 4 expressions with local error:

20.5b
(cbrt (fma (* (* b a) (* b a)) 2 (+ (pow b 4) (pow a 4))))
20.5b
(cbrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
12.6b
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
2.4b
(sqrt (cbrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))

rewrite4.0ms

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

series380.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
118.0ms
(sqrt (cbrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))
112.0ms
(cbrt (fma (* (* b a) (* b a)) 2 (+ (pow b 4) (pow a 4))))
109.0ms
(cbrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))
41.0ms
(sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))

simplify1.4s

Counts
30 → 70
Calls
30 calls:
Slowest
135.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))))))
120.0ms
(sqrt (cbrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))))))
105.0ms
(cbrt (* (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))))))
97.0ms
(cbrt (sqrt (fma (* (* b a) (* b a)) 2 (+ (pow b 4) (pow a 4)))))
97.0ms
(cbrt (sqrt (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))))

prune1.8s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0.0b

regimes104.0ms

Accuracy

0% (0.0b remaining)

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

bsearch3.0ms

end0.0ms

sample5.1s

Algorithm
intervals