Average Error: 0.2 → 0.0
Time: 32.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((\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 2018362 +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: 25.7s)Debug log

start240.0ms

Algorithm
intervals

setup253.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize46.0ms

Local error

Found 4 expressions with local error:

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

rewrite46.0ms

Algorithm
rewrite-expression-head
Counts
4 → 81
Calls

4 calls. Slowest were:

25.0ms
(* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))
8.0ms
(* (* b b) (- 1 (* 3 a)))
7.0ms
(* (* a a) (+ 1 a))

series138.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

48.0ms
(* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))
36.0ms
(* (* a a) (+ 1 a))
31.0ms
(pow (+ (* a a) (* b b)) 2)
24.0ms
(* (* b b) (- 1 (* 3 a)))

simplify10.9s

Counts
50 → 93
Calls

50 calls. Slowest were:

1.3s
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
1.0s
(* (+ (* 1 1) (- (* a a) (* 1 a))) (+ (* 1 1) (+ (* (* 3 a) (* 3 a)) (* 1 (* 3 a)))))
795.0ms
(* (- 1 a) (+ 1 (* 3 a)))

prune1.9s

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize44.0ms

Local error

Found 4 expressions with local error:

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

rewrite43.0ms

Algorithm
rewrite-expression-head
Counts
4 → 83
Calls

4 calls. Slowest were:

20.0ms
(* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))
8.0ms
(* (* b b) (- 1 (* 3 a)))
7.0ms
(* (* a a) (+ 1 a))

series120.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

34.0ms
(* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))
31.0ms
(* (* a a) (+ 1 a))
29.0ms
(* (* b b) (- 1 (* 3 a)))
26.0ms
(* (* a b) (* a b))

simplify10.0s

Counts
51 → 95
Calls

51 calls. Slowest were:

951.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
749.0ms
(* (- 1 a) (+ 1 (* 3 a)))
731.0ms
(* (+ (* 1 1) (- (* a a) (* 1 a))) (+ (* 1 1) (+ (* (* 3 a) (* 3 a)) (* 1 (* 3 a)))))

prune2.0s

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0.0b