Average Error: 0.2 → 0.0
Time: 14.9s
Precision: 64
Internal Precision: 128
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left(4 \cdot \left(b \cdot b\right) - 1\right) + (2 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) + \left({b}^{4} + {a}^{4}\right))_*\]

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(b \cdot b\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(b \cdot b\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(b \cdot b\right)\right) - 1\]
  4. Using strategy rm
  5. Applied associate--l+0.0

    \[\leadsto \color{blue}{(2 \cdot \left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) + \left({a}^{4} + {b}^{4}\right))_* + \left(4 \cdot \left(b \cdot b\right) - 1\right)}\]
  6. Final simplification0.0

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

Reproduce

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

Details

Time bar (total: 14.5s)Debug log

sample173.0ms

Algorithm
intervals

simplify478.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

478.0ms
(- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1)

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize23.0ms

Local error

Found 4 expressions with local error:

0.4b
(pow (+ (* a a) (* b b)) 2)
0.0b
(* 4 (* b b))
0.0b
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b)))
0.0b
(+ (* a a) (* b b))

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

17.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b)))
3.0ms
(pow (+ (* a a) (* b b)) 2)
2.0ms
(+ (* a a) (* b b))

series104.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

35.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b)))
35.0ms
(pow (+ (* a a) (* b b)) 2)
18.0ms
(* 4 (* b b))
15.0ms
(+ (* a a) (* b b))

simplify1.3s

Counts
25 → 73
Calls

25 calls. Slowest were:

171.0ms
(* (exp (pow (+ (* a a) (* b b)) 2)) (exp (* 4 (* b b))))
150.0ms
(* (cbrt (pow (+ (* a a) (* b b)) 2)) (cbrt (pow (+ (* a a) (* b b)) 2)))
146.0ms
(+ (* 2 (* (pow a 2) (pow b 2))) (+ (* 4 (pow b 2)) (pow a 4)))

prune744.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize39.0ms

Local error

Found 4 expressions with local error:

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

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

18.0ms
(- (+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (* b b))) 1)
7.0ms
(* (* a b) (* a b))
4.0ms
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (* b b)))

series138.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

54.0ms
(+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (* b b)))
40.0ms
(- (+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (* b b))) 1)
24.0ms
(* (* a b) (* a b))
20.0ms
(* 4 (* b b))

simplify2.7s

Counts
27 → 77
Calls

27 calls. Slowest were:

710.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
244.0ms
(sqrt (+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (* b b))))
219.0ms
(* (cbrt (+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (* b b)))) (cbrt (+ (fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4))) (* 4 (* b b)))))

prune1.0s

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 54
Calls

4 calls. Slowest were:

7.0ms
(* (* a b) (* a b))
5.0ms
(- (* 4 (* b b)) 1)
2.0ms
(* 4 (* b b))

series119.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

43.0ms
(- (* 4 (* b b)) 1)
28.0ms
(fma 2 (* (* a b) (* a b)) (+ (pow a 4) (pow b 4)))
28.0ms
(* (* a b) (* a b))
19.0ms
(* 4 (* b b))

simplify1.1s

Counts
19 → 66
Calls

19 calls. Slowest were:

665.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
106.0ms
(+ (pow b 4) (+ (pow a 4) (* 2 (* (pow a 2) (pow b 2)))))
102.0ms
(+ (pow b 4) (+ (pow a 4) (* 2 (* (pow a 2) (pow b 2)))))

prune903.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize33.0ms

Local error

Found 4 expressions with local error:

9.8b
(sqrt (+ (* a a) (* b b)))
0.3b
(fma (fma b b (* a a)) (pow (sqrt (+ (* a a) (* b b))) 2) (* 4 (* b b)))
0.0b
(* 4 (* b b))
0.0b
(pow (sqrt (+ (* a a) (* b b))) 2)

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

3.0ms
(pow (sqrt (+ (* a a) (* b b))) 2)
2.0ms
(sqrt (+ (* a a) (* b b)))
1.0ms
(* 4 (* b b))

series158.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

79.0ms
(fma (fma b b (* a a)) (pow (sqrt (+ (* a a) (* b b))) 2) (* 4 (* b b)))
36.0ms
(pow (sqrt (+ (* a a) (* b b))) 2)
23.0ms
(sqrt (+ (* a a) (* b b)))
20.0ms
(* 4 (* b b))

simplify740.0ms

Counts
27 → 70
Calls

27 calls. Slowest were:

174.0ms
(sqrt (- (* (* a a) (* a a)) (* (* b b) (* b b))))
138.0ms
(+ (pow b 4) (+ (* 2 (* (pow a 2) (pow b 2))) (* 4 (pow b 2))))
131.0ms
(+ (pow b 4) (+ (* 2 (* (pow a 2) (pow b 2))) (pow a 4)))

prune926.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes115.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample3.6s

Algorithm
intervals