Average Error: 0.5 → 0.6
Time: 19.6s
Precision: binary64
\[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 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot \left(x1 \cdot \left(\sqrt[3]{4 \cdot \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(2 \cdot x2 - x1\right)}{x1 \cdot x1 + 1} - 6} \cdot \sqrt[3]{4 \cdot \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(2 \cdot x2 - x1\right)}{x1 \cdot x1 + 1} - 6}\right)\right)\right) \cdot \sqrt[3]{\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6}\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\]
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 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot \left(x1 \cdot \left(\sqrt[3]{4 \cdot \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(2 \cdot x2 - x1\right)}{x1 \cdot x1 + 1} - 6} \cdot \sqrt[3]{4 \cdot \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(2 \cdot x2 - x1\right)}{x1 \cdot x1 + 1} - 6}\right)\right)\right) \cdot \sqrt[3]{\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6}\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)
double code(double x1, double x2) {
	return ((double) (x1 + ((double) (((double) (((double) (((double) (((double) (((double) (((double) (((double) (((double) (2.0 * x1)) * (((double) (((double) (((double) (((double) (3.0 * x1)) * x1)) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))))) * ((double) ((((double) (((double) (((double) (((double) (3.0 * x1)) * x1)) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))) - 3.0)))) + ((double) (((double) (x1 * x1)) * ((double) (((double) (4.0 * (((double) (((double) (((double) (((double) (3.0 * x1)) * x1)) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))))) - 6.0)))))) * ((double) (((double) (x1 * x1)) + 1.0)))) + ((double) (((double) (((double) (3.0 * x1)) * x1)) * (((double) (((double) (((double) (((double) (3.0 * x1)) * x1)) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))))))) + ((double) (((double) (x1 * x1)) * x1)))) + x1)) + ((double) (3.0 * (((double) (((double) (((double) (((double) (3.0 * x1)) * x1)) - ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0)))))))));
}
double code(double x1, double x2) {
	return ((double) (x1 + ((double) (((double) (x1 + ((double) (((double) (((double) (((double) (((double) (x1 * x1)) + 1.0)) * ((double) (((double) (((double) (((double) (x1 * 2.0)) * (((double) (((double) (((double) (x1 * ((double) (x1 * 3.0)))) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))))) * ((double) ((((double) (((double) (((double) (x1 * ((double) (x1 * 3.0)))) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))) - 3.0)))) + ((double) (((double) (x1 * ((double) (x1 * ((double) (((double) cbrt(((double) (((double) (4.0 * (((double) (((double) (x1 * ((double) (x1 * 3.0)))) + ((double) (((double) (2.0 * x2)) - x1)))) / ((double) (((double) (x1 * x1)) + 1.0))))) - 6.0)))) * ((double) cbrt(((double) (((double) (4.0 * (((double) (((double) (x1 * ((double) (x1 * 3.0)))) + ((double) (((double) (2.0 * x2)) - x1)))) / ((double) (((double) (x1 * x1)) + 1.0))))) - 6.0)))))))))) * ((double) cbrt(((double) (((double) ((((double) (((double) (((double) (x1 * ((double) (x1 * 3.0)))) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))) * 4.0)) - 6.0)))))))))) + ((double) (((double) (x1 * ((double) (x1 * 3.0)))) * (((double) (((double) (((double) (x1 * ((double) (x1 * 3.0)))) + ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0))))))) + ((double) (x1 * ((double) (x1 * x1)))))))) + ((double) (3.0 * (((double) (((double) (((double) (x1 * ((double) (x1 * 3.0)))) - ((double) (2.0 * x2)))) - x1)) / ((double) (((double) (x1 * x1)) + 1.0)))))))));
}

Error

Bits error versus x1

Bits error versus x2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.5

    \[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. Using strategy rm
  3. Applied add-cube-cbrt0.6

    \[\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 \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 \color{blue}{\left(\left(\sqrt[3]{4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6} \cdot \sqrt[3]{4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6}\right) \cdot \sqrt[3]{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. Applied associate-*r*0.6

    \[\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 \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(\sqrt[3]{4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6} \cdot \sqrt[3]{4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6}\right)\right) \cdot \sqrt[3]{4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6}}\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)\]
  5. Simplified0.6

    \[\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 \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{\left(x1 \cdot \left(x1 \cdot \left(\sqrt[3]{4 \cdot \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(2 \cdot x2 - x1\right)}{x1 \cdot x1 + 1} - 6} \cdot \sqrt[3]{4 \cdot \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(2 \cdot x2 - x1\right)}{x1 \cdot x1 + 1} - 6}\right)\right)\right)} \cdot \sqrt[3]{4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6}\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)\]
  6. Final simplification0.6

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

Reproduce

herbie shell --seed 2020196 
(FPCore (x1 x2)
  :name "Rosa's FloatVsDoubleBenchmark"
  :precision binary64
  (+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2.0 x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) (- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0)) (* (* x1 x1) (- (* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) 6.0))) (+ (* x1 x1) 1.0)) (* (* (* 3.0 x1) x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))) (* (* x1 x1) x1)) x1) (* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))