Average Error: 5.0 → 4.8
Time: 4.6m
Precision: 64
Internal Precision: 128
\[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\]
\[x1 + \left((\left((x1 \cdot 9 + -2)_*\right) \cdot x1 + \left(-6 \cdot x2\right))_* + (\left((\left(x1 \cdot x1\right) \cdot \left((4 \cdot \left(\frac{(\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*}{(x1 \cdot x1 + 1)_*}\right) + -6)_*\right) + \left(\frac{(\left((\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2\right))_*\right) \cdot \left(2 \cdot x1\right) + \left(x1 \cdot \left(-2 \cdot x1\right)\right))_*}{\frac{(x1 \cdot x1 + 1)_*}{(2 \cdot x2 + \left(-3 - x1\right))_*}}\right))_*\right) \cdot \left((x1 \cdot x1 + 1)_*\right) + \left((\left(x1 \cdot x1\right) \cdot x1 + \left((\left(x1 \cdot x1\right) \cdot \left((-3 \cdot x1 + \left(x2 \cdot 6\right))_*\right) + \left(9 \cdot {x1}^{4}\right))_*\right))_*\right))_*\right)\]

Error

Bits error versus x1

Bits error versus x2

Derivation

  1. Initial program 5.0

    \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\]
  2. Taylor expanded around 0 5.0

    \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \color{blue}{\left(2 \cdot x2 - \left(x1 + 3\right)\right)} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\]
  3. Simplified5.0

    \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \color{blue}{(x2 \cdot 2 + \left(-3 - x1\right))_*} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\]
  4. Using strategy rm
  5. Applied associate-+l+5.0

    \[\leadsto x1 + \color{blue}{\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot (x2 \cdot 2 + \left(-3 - x1\right))_* + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + \left(x1 + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\right)}\]
  6. Simplified5.1

    \[\leadsto x1 + \left(\color{blue}{(\left((\left(x1 \cdot x1\right) \cdot \left((4 \cdot \left(\frac{(\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*}{(x1 \cdot x1 + 1)_*}\right) + -6)_*\right) + \left(\frac{(\left((\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2\right))_*\right) \cdot \left(2 \cdot x1\right) + \left(\left(2 \cdot x1\right) \cdot \left(-x1\right)\right))_*}{\frac{(x1 \cdot x1 + 1)_*}{(2 \cdot x2 + \left(-3 - x1\right))_*}}\right))_*\right) \cdot \left((x1 \cdot x1 + 1)_*\right) + \left((\left(x1 \cdot x1\right) \cdot x1 + \left(\frac{\left(x1 \cdot x1\right) \cdot 3}{(x1 \cdot x1 + 1)_*} \cdot (\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*\right))_*\right))_*} + \left(x1 + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\right)\]
  7. Taylor expanded around 0 4.8

    \[\leadsto x1 + \left((\left((\left(x1 \cdot x1\right) \cdot \left((4 \cdot \left(\frac{(\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*}{(x1 \cdot x1 + 1)_*}\right) + -6)_*\right) + \left(\frac{(\left((\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2\right))_*\right) \cdot \left(2 \cdot x1\right) + \left(\left(2 \cdot x1\right) \cdot \left(-x1\right)\right))_*}{\frac{(x1 \cdot x1 + 1)_*}{(2 \cdot x2 + \left(-3 - x1\right))_*}}\right))_*\right) \cdot \left((x1 \cdot x1 + 1)_*\right) + \left((\left(x1 \cdot x1\right) \cdot x1 + \left(\frac{\left(x1 \cdot x1\right) \cdot 3}{(x1 \cdot x1 + 1)_*} \cdot (\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*\right))_*\right))_* + \color{blue}{\left(9 \cdot {x1}^{2} - \left(2 \cdot x1 + 6 \cdot x2\right)\right)}\right)\]
  8. Simplified4.8

    \[\leadsto x1 + \left((\left((\left(x1 \cdot x1\right) \cdot \left((4 \cdot \left(\frac{(\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*}{(x1 \cdot x1 + 1)_*}\right) + -6)_*\right) + \left(\frac{(\left((\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2\right))_*\right) \cdot \left(2 \cdot x1\right) + \left(\left(2 \cdot x1\right) \cdot \left(-x1\right)\right))_*}{\frac{(x1 \cdot x1 + 1)_*}{(2 \cdot x2 + \left(-3 - x1\right))_*}}\right))_*\right) \cdot \left((x1 \cdot x1 + 1)_*\right) + \left((\left(x1 \cdot x1\right) \cdot x1 + \left(\frac{\left(x1 \cdot x1\right) \cdot 3}{(x1 \cdot x1 + 1)_*} \cdot (\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*\right))_*\right))_* + \color{blue}{(\left((x1 \cdot 9 + -2)_*\right) \cdot x1 + \left(x2 \cdot -6\right))_*}\right)\]
  9. Taylor expanded around 0 4.8

    \[\leadsto x1 + \left((\left((\left(x1 \cdot x1\right) \cdot \left((4 \cdot \left(\frac{(\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*}{(x1 \cdot x1 + 1)_*}\right) + -6)_*\right) + \left(\frac{(\left((\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2\right))_*\right) \cdot \left(2 \cdot x1\right) + \left(\left(2 \cdot x1\right) \cdot \left(-x1\right)\right))_*}{\frac{(x1 \cdot x1 + 1)_*}{(2 \cdot x2 + \left(-3 - x1\right))_*}}\right))_*\right) \cdot \left((x1 \cdot x1 + 1)_*\right) + \left((\left(x1 \cdot x1\right) \cdot x1 + \color{blue}{\left(\left(6 \cdot \left({x1}^{2} \cdot x2\right) + 9 \cdot {x1}^{4}\right) - 3 \cdot {x1}^{3}\right)})_*\right))_* + (\left((x1 \cdot 9 + -2)_*\right) \cdot x1 + \left(x2 \cdot -6\right))_*\right)\]
  10. Simplified4.8

    \[\leadsto x1 + \left((\left((\left(x1 \cdot x1\right) \cdot \left((4 \cdot \left(\frac{(\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*}{(x1 \cdot x1 + 1)_*}\right) + -6)_*\right) + \left(\frac{(\left((\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2\right))_*\right) \cdot \left(2 \cdot x1\right) + \left(\left(2 \cdot x1\right) \cdot \left(-x1\right)\right))_*}{\frac{(x1 \cdot x1 + 1)_*}{(2 \cdot x2 + \left(-3 - x1\right))_*}}\right))_*\right) \cdot \left((x1 \cdot x1 + 1)_*\right) + \left((\left(x1 \cdot x1\right) \cdot x1 + \color{blue}{\left((\left(x1 \cdot x1\right) \cdot \left((-3 \cdot x1 + \left(x2 \cdot 6\right))_*\right) + \left({x1}^{4} \cdot 9\right))_*\right)})_*\right))_* + (\left((x1 \cdot 9 + -2)_*\right) \cdot x1 + \left(x2 \cdot -6\right))_*\right)\]
  11. Final simplification4.8

    \[\leadsto x1 + \left((\left((x1 \cdot 9 + -2)_*\right) \cdot x1 + \left(-6 \cdot x2\right))_* + (\left((\left(x1 \cdot x1\right) \cdot \left((4 \cdot \left(\frac{(\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right))_*}{(x1 \cdot x1 + 1)_*}\right) + -6)_*\right) + \left(\frac{(\left((\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2\right))_*\right) \cdot \left(2 \cdot x1\right) + \left(x1 \cdot \left(-2 \cdot x1\right)\right))_*}{\frac{(x1 \cdot x1 + 1)_*}{(2 \cdot x2 + \left(-3 - x1\right))_*}}\right))_*\right) \cdot \left((x1 \cdot x1 + 1)_*\right) + \left((\left(x1 \cdot x1\right) \cdot x1 + \left((\left(x1 \cdot x1\right) \cdot \left((-3 \cdot x1 + \left(x2 \cdot 6\right))_*\right) + \left(9 \cdot {x1}^{4}\right))_*\right))_*\right))_*\right)\]

Runtime

Time bar (total: 4.6m)Debug logProfile

herbie shell --seed 2018255 +o rules:numerics
(FPCore (x1 x2)
  :name "Rosa's FloatVsDoubleBenchmark"
  (+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2 x1) (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1))) (- (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1)) 3)) (* (* x1 x1) (- (* 4 (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1))) 6))) (+ (* x1 x1) 1)) (* (* (* 3 x1) x1) (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1)))) (* (* x1 x1) x1)) x1) (* 3 (/ (- (- (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1))))))