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

    \[\leadsto \left((\left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) \cdot 2 + \left({a}^{4} + {b}^{4}\right))_* + 4 \cdot \left(\left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right) + \left(a + 1\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: 28.6s)Debug log

sample225.0ms

Algorithm
intervals

simplify199.0ms

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

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

rewrite56.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
33.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
9.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
60.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
40.0ms
(* (* b b) (- 1 (* 3 a)))
32.0ms
(pow (+ (* a a) (* b b)) 2)
22.0ms
(* (* a a) (+ 1 a))

simplify5.4s

Counts
48 → 94
Calls
48 calls:
Slowest
912.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
650.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
454.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
353.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)
303.0ms
(+ (* 1 1) (+ (* (* 3 a) (* 3 a)) (* 1 (* 3 a))))

prune1.1s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize24.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 (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))

rewrite24.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 (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
5.0ms
(* (* a a) (+ 1 a))
4.0ms
(* (* b b) (- 1 (* 3 a)))
4.0ms
(* (* a b) (* a b))

series213.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
101.0ms
(+ (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
46.0ms
(* (* b b) (- 1 (* 3 a)))
38.0ms
(* (* a a) (+ 1 a))
28.0ms
(* (* a b) (* a b))

simplify5.6s

Counts
46 → 93
Calls
46 calls:
Slowest
966.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
687.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
659.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
388.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
304.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)

prune1.7s

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

12.6b
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
12.6b
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
1.0b
(* (* b b) (- 1 (* 3 a)))
0.2b
(fma (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))) (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))

rewrite12.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
8.0ms
(* (* b b) (- 1 (* 3 a)))
2.0ms
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
1.0ms
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
0.0ms
(fma (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))) (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))

series285.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
139.0ms
(fma (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))) (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
63.0ms
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
48.0ms
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
35.0ms
(* (* b b) (- 1 (* 3 a)))

simplify3.2s

Counts
32 → 73
Calls
32 calls:
Slowest
654.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
351.0ms
(* (* b b) (- 1 (* 3 a)))
230.0ms
(+ (* 4 (pow a 2)) (+ (* 4 (pow b 2)) (* 4 (pow a 3))))
225.0ms
(+ (* 1 1) (+ (* (* 3 a) (* 3 a)) (* 1 (* 3 a))))
178.0ms
(- (pow b 2) (* 3 (* a (pow b 2))))

prune1.3s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0.0b

localize55.0ms

Local error

Found 4 expressions with local error:

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

rewrite8.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
2.0ms
(sqrt (cbrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))))
2.0ms
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
1.0ms
(cbrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
1.0ms
(cbrt (fma (* (* a b) (* a b)) 2 (+ (pow a 4) (pow b 4))))

series469.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
149.0ms
(sqrt (cbrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))))
129.0ms
(cbrt (fma (* (* a b) (* a b)) 2 (+ (pow a 4) (pow b 4))))
128.0ms
(cbrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))
64.0ms
(sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))

simplify1.4s

Counts
30 → 70
Calls
30 calls:
Slowest
121.0ms
(sqrt (cbrt (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))))
111.0ms
(cbrt (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))))
108.0ms
(cbrt (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))))
107.0ms
(cbrt (sqrt (fma (* (* a b) (* a b)) 2 (+ (pow a 4) (pow b 4)))))
105.0ms
(sqrt (* (cbrt (cbrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))))) (cbrt (cbrt (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4)))))))

prune1.6s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0.0b

regimes100.0ms

Accuracy

0% (0.0b remaining)

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

bsearch6.0ms

end0.0ms

sample5.4s

Algorithm
intervals