Average Error: 0.2 → 0.0
Time: 36.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 2019016 +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: 35.9s)Debug log

sample226.0ms

Algorithm
intervals
Results
674×(pre true 80)
674×(body real 80)

simplify205.0ms

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

prune14.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize48.0ms

Local error

Found 4 expressions with local error:

0.7b
(* (* 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))))))

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

series168.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
84.0ms
(+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
39.0ms
(* (* b b) (- 1 (* 3 a)))
23.0ms
(* (* a a) (+ 1 a))
21.0ms
(pow (+ (* a a) (* b b)) 2)

simplify4.6s

Counts
48 → 94
Calls
48 calls:
Slowest
907.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
475.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
408.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
274.0ms
(+ (* 4 (pow a 2)) (+ (* 4 (pow b 2)) (* 4 (pow a 3))))
234.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)

prune1.3s

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.0b

localize46.0ms

Local error

Found 4 expressions with local error:

0.7b
(* (* 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))))))

rewrite29.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
(+ (fma (* (* a b) (* a b)) 2 (+ (pow b 4) (pow a 4))) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))))
7.0ms
(* (* b b) (- 1 (* 3 a)))
6.0ms
(* (* a b) (* a b))
6.0ms
(* (* a a) (+ 1 a))

series199.0ms

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

simplify4.8s

Counts
46 → 93
Calls
46 calls:
Slowest
775.0ms
(* (* (* (* a a) (* a a)) (* a a)) (* (* (+ 1 a) (+ 1 a)) (+ 1 a)))
574.0ms
(* (* (* (* a b) (* a b)) (* a b)) (* (* (* a b) (* a b)) (* a b)))
436.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
321.0ms
(* 4 (* (* b b) (- 1 (* 3 a))))
315.0ms
(* (* (* b b) (- 1 (* 3 a))) 4)

prune1.3s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 4 expressions with local error:

8.8b
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
8.8b
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
0.7b
(* (* b b) (- 1 (* 3 a)))
0.7b
(* (* b b) (- 1 (* 3 a)))

rewrite68.0ms

Algorithm
rewrite-expression-head
Rules
10×add-sqr-sqrt
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
sqrt-prod
associate-*r*
add-log-exp
log1p-expm1-u
associate-*r/
sqrt-div
distribute-lft-in
sub-neg
expm1-log1p-u
distribute-rgt-in
flip--
flip-+
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
associate-*l*
pow1/2
flip3--
flip3-+
rem-sqrt-square
Counts
4 → 78
Calls
4 calls:
Slowest
38.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
20.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
4.0ms
(* (* b b) (- 1 (* 3 a)))
4.0ms
(* (* b b) (- 1 (* 3 a)))

series239.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
101.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
81.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
33.0ms
(* (* b b) (- 1 (* 3 a)))
24.0ms
(* (* b b) (- 1 (* 3 a)))

simplify7.6s

Counts
48 → 90
Calls
48 calls:
Slowest
1.1s
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
701.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
323.0ms
(- (* 2 b) (+ (* 3 (* a b)) (* 15/8 (* (pow a 2) b))))
311.0ms
(sqrt (+ (pow (pow (+ (* a a) (* b b)) 2) 3) (pow (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))) 3)))
302.0ms
(- (* 2 b) (+ (* 3 (* a b)) (* 15/8 (* (pow a 2) b))))

prune1.4s

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 4 expressions with local error:

8.8b
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
8.8b
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
8.8b
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
0.7b
(* (* b b) (- 1 (* 3 a)))

rewrite56.0ms

Algorithm
rewrite-expression-head
Rules
11×add-sqr-sqrt
sqrt-prod
add-cube-cbrt
*-un-lft-identity
add-exp-log
sqrt-div
add-cbrt-cube
pow1
add-log-exp
log1p-expm1-u
expm1-log1p-u
flip-+
associate-*r*
pow1/2
flip3-+
rem-sqrt-square
associate-*r/
distribute-lft-in
sub-neg
distribute-rgt-in
flip--
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
associate-*l*
flip3--
Counts
4 → 71
Calls
4 calls:
Slowest
17.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
17.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
17.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
5.0ms
(* (* b b) (- 1 (* 3 a)))

series360.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
122.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
101.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
97.0ms
(sqrt (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))))
40.0ms
(* (* b b) (- 1 (* 3 a)))

simplify6.3s

Counts
42 → 83
Calls
42 calls:
Slowest
561.0ms
(* (* (* (* b b) (* b b)) (* b b)) (* (* (- 1 (* 3 a)) (- 1 (* 3 a))) (- 1 (* 3 a))))
353.0ms
(- (* 2 b) (+ (* 3 (* a b)) (* 15/8 (* (pow a 2) b))))
313.0ms
(sqrt (+ (pow (pow (+ (* a a) (* b b)) 2) 3) (pow (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))) 3)))
290.0ms
(- (* 2 b) (+ (* 3 (* a b)) (* 15/8 (* (pow a 2) b))))
267.0ms
(sqrt (+ (pow (pow (+ (* a a) (* b b)) 2) 3) (pow (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a))))) 3)))

prune1.4s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0.0b

regimes131.0ms

Accuracy

0% (0.0b remaining)

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

bsearch4.0ms

end0.0ms

sample5.4s

Algorithm
intervals
Results
20583×(pre true 80)
20583×(body real 80)