Average Error: 0.5 → 0.5
Time: 49.6s
Precision: 64
\[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)\]
\[\left(\left(\left(x1 \cdot \left(\frac{4 \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)\right)}{1 + x1 \cdot x1} - 6\right)\right) \cdot x1 + x1\right) \cdot \left(1 + x1 \cdot x1\right) + \frac{\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)}{1 + x1 \cdot x1} \cdot \left(x1 \cdot \left(\left(\frac{\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)}{1 + x1 \cdot x1} - 3\right) \cdot \left(\left(1 + x1 \cdot x1\right) \cdot 2\right)\right) + \left(x1 \cdot x1\right) \cdot 3\right)\right) + \left(\frac{\left(x1 \cdot x1\right) \cdot 3 - \left(x1 - -2 \cdot x2\right)}{1 + x1 \cdot x1} \cdot 3 + x1\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)
\left(\left(\left(x1 \cdot \left(\frac{4 \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)\right)}{1 + x1 \cdot x1} - 6\right)\right) \cdot x1 + x1\right) \cdot \left(1 + x1 \cdot x1\right) + \frac{\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)}{1 + x1 \cdot x1} \cdot \left(x1 \cdot \left(\left(\frac{\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)}{1 + x1 \cdot x1} - 3\right) \cdot \left(\left(1 + x1 \cdot x1\right) \cdot 2\right)\right) + \left(x1 \cdot x1\right) \cdot 3\right)\right) + \left(\frac{\left(x1 \cdot x1\right) \cdot 3 - \left(x1 - -2 \cdot x2\right)}{1 + x1 \cdot x1} \cdot 3 + x1\right)
double f(double x1, double x2) {
        double r3339778 = x1;
        double r3339779 = 2.0;
        double r3339780 = r3339779 * r3339778;
        double r3339781 = 3.0;
        double r3339782 = r3339781 * r3339778;
        double r3339783 = r3339782 * r3339778;
        double r3339784 = x2;
        double r3339785 = r3339779 * r3339784;
        double r3339786 = r3339783 + r3339785;
        double r3339787 = r3339786 - r3339778;
        double r3339788 = r3339778 * r3339778;
        double r3339789 = 1.0;
        double r3339790 = r3339788 + r3339789;
        double r3339791 = r3339787 / r3339790;
        double r3339792 = r3339780 * r3339791;
        double r3339793 = r3339791 - r3339781;
        double r3339794 = r3339792 * r3339793;
        double r3339795 = 4.0;
        double r3339796 = r3339795 * r3339791;
        double r3339797 = 6.0;
        double r3339798 = r3339796 - r3339797;
        double r3339799 = r3339788 * r3339798;
        double r3339800 = r3339794 + r3339799;
        double r3339801 = r3339800 * r3339790;
        double r3339802 = r3339783 * r3339791;
        double r3339803 = r3339801 + r3339802;
        double r3339804 = r3339788 * r3339778;
        double r3339805 = r3339803 + r3339804;
        double r3339806 = r3339805 + r3339778;
        double r3339807 = r3339783 - r3339785;
        double r3339808 = r3339807 - r3339778;
        double r3339809 = r3339808 / r3339790;
        double r3339810 = r3339781 * r3339809;
        double r3339811 = r3339806 + r3339810;
        double r3339812 = r3339778 + r3339811;
        return r3339812;
}

double f(double x1, double x2) {
        double r3339813 = x1;
        double r3339814 = 4.0;
        double r3339815 = r3339813 * r3339813;
        double r3339816 = 3.0;
        double r3339817 = r3339815 * r3339816;
        double r3339818 = 2.0;
        double r3339819 = x2;
        double r3339820 = r3339818 * r3339819;
        double r3339821 = r3339820 - r3339813;
        double r3339822 = r3339817 + r3339821;
        double r3339823 = r3339814 * r3339822;
        double r3339824 = 1.0;
        double r3339825 = r3339824 + r3339815;
        double r3339826 = r3339823 / r3339825;
        double r3339827 = 6.0;
        double r3339828 = r3339826 - r3339827;
        double r3339829 = r3339813 * r3339828;
        double r3339830 = r3339829 * r3339813;
        double r3339831 = r3339830 + r3339813;
        double r3339832 = r3339831 * r3339825;
        double r3339833 = r3339822 / r3339825;
        double r3339834 = r3339833 - r3339816;
        double r3339835 = r3339825 * r3339818;
        double r3339836 = r3339834 * r3339835;
        double r3339837 = r3339813 * r3339836;
        double r3339838 = r3339837 + r3339817;
        double r3339839 = r3339833 * r3339838;
        double r3339840 = r3339832 + r3339839;
        double r3339841 = -2.0;
        double r3339842 = r3339841 * r3339819;
        double r3339843 = r3339813 - r3339842;
        double r3339844 = r3339817 - r3339843;
        double r3339845 = r3339844 / r3339825;
        double r3339846 = r3339845 * r3339816;
        double r3339847 = r3339846 + r3339813;
        double r3339848 = r3339840 + r3339847;
        return r3339848;
}

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. Simplified0.5

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

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

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

Reproduce

herbie shell --seed 2019135 
(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))))))