Average Error: 0.5 → 0.5
Time: 1.2m
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(\left(\left(1 + x1 \cdot x1\right) \cdot \left(\left(x1 \cdot \left(x1 \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1}{1 + x1 \cdot x1} \cdot 4\right)\right) + \left(-\left(x1 \cdot x1\right) \cdot 6\right)\right) + \frac{\left(\left(x1 \cdot 2\right) \cdot \left(\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1\right)\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1}{1 + x1 \cdot x1} - 3\right)}{1 + x1 \cdot x1}\right) + \frac{\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1}{1 + x1 \cdot x1} \cdot \left(\left(3 \cdot x1\right) \cdot x1\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - x2 \cdot 2\right) - x1}{1 + x1 \cdot x1}\right) + x1\]
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(\left(\left(1 + x1 \cdot x1\right) \cdot \left(\left(x1 \cdot \left(x1 \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1}{1 + x1 \cdot x1} \cdot 4\right)\right) + \left(-\left(x1 \cdot x1\right) \cdot 6\right)\right) + \frac{\left(\left(x1 \cdot 2\right) \cdot \left(\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1\right)\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1}{1 + x1 \cdot x1} - 3\right)}{1 + x1 \cdot x1}\right) + \frac{\left(\left(3 \cdot x1\right) \cdot x1 + x2 \cdot 2\right) - x1}{1 + x1 \cdot x1} \cdot \left(\left(3 \cdot x1\right) \cdot x1\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - x2 \cdot 2\right) - x1}{1 + x1 \cdot x1}\right) + x1
double f(double x1, double x2) {
        double r2640052 = x1;
        double r2640053 = 2.0;
        double r2640054 = r2640053 * r2640052;
        double r2640055 = 3.0;
        double r2640056 = r2640055 * r2640052;
        double r2640057 = r2640056 * r2640052;
        double r2640058 = x2;
        double r2640059 = r2640053 * r2640058;
        double r2640060 = r2640057 + r2640059;
        double r2640061 = r2640060 - r2640052;
        double r2640062 = r2640052 * r2640052;
        double r2640063 = 1.0;
        double r2640064 = r2640062 + r2640063;
        double r2640065 = r2640061 / r2640064;
        double r2640066 = r2640054 * r2640065;
        double r2640067 = r2640065 - r2640055;
        double r2640068 = r2640066 * r2640067;
        double r2640069 = 4.0;
        double r2640070 = r2640069 * r2640065;
        double r2640071 = 6.0;
        double r2640072 = r2640070 - r2640071;
        double r2640073 = r2640062 * r2640072;
        double r2640074 = r2640068 + r2640073;
        double r2640075 = r2640074 * r2640064;
        double r2640076 = r2640057 * r2640065;
        double r2640077 = r2640075 + r2640076;
        double r2640078 = r2640062 * r2640052;
        double r2640079 = r2640077 + r2640078;
        double r2640080 = r2640079 + r2640052;
        double r2640081 = r2640057 - r2640059;
        double r2640082 = r2640081 - r2640052;
        double r2640083 = r2640082 / r2640064;
        double r2640084 = r2640055 * r2640083;
        double r2640085 = r2640080 + r2640084;
        double r2640086 = r2640052 + r2640085;
        return r2640086;
}

double f(double x1, double x2) {
        double r2640087 = 1.0;
        double r2640088 = x1;
        double r2640089 = r2640088 * r2640088;
        double r2640090 = r2640087 + r2640089;
        double r2640091 = 3.0;
        double r2640092 = r2640091 * r2640088;
        double r2640093 = r2640092 * r2640088;
        double r2640094 = x2;
        double r2640095 = 2.0;
        double r2640096 = r2640094 * r2640095;
        double r2640097 = r2640093 + r2640096;
        double r2640098 = r2640097 - r2640088;
        double r2640099 = r2640098 / r2640090;
        double r2640100 = 4.0;
        double r2640101 = r2640099 * r2640100;
        double r2640102 = r2640088 * r2640101;
        double r2640103 = r2640088 * r2640102;
        double r2640104 = 6.0;
        double r2640105 = r2640089 * r2640104;
        double r2640106 = -r2640105;
        double r2640107 = r2640103 + r2640106;
        double r2640108 = r2640088 * r2640095;
        double r2640109 = r2640108 * r2640098;
        double r2640110 = r2640099 - r2640091;
        double r2640111 = r2640109 * r2640110;
        double r2640112 = r2640111 / r2640090;
        double r2640113 = r2640107 + r2640112;
        double r2640114 = r2640090 * r2640113;
        double r2640115 = r2640099 * r2640093;
        double r2640116 = r2640114 + r2640115;
        double r2640117 = r2640089 * r2640088;
        double r2640118 = r2640116 + r2640117;
        double r2640119 = r2640118 + r2640088;
        double r2640120 = r2640093 - r2640096;
        double r2640121 = r2640120 - r2640088;
        double r2640122 = r2640121 / r2640090;
        double r2640123 = r2640091 * r2640122;
        double r2640124 = r2640119 + r2640123;
        double r2640125 = r2640124 + r2640088;
        return r2640125;
}

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 sub-neg0.5

    \[\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(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(-6\right)\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 distribute-rgt-in0.5

    \[\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(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(x1 \cdot x1\right) + \left(-6\right) \cdot \left(x1 \cdot x1\right)\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)\]
  5. Using strategy rm
  6. Applied associate-*r*0.5

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

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

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

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

Reproduce

herbie shell --seed 2019169 +o rules:numerics
(FPCore (x1 x2)
  :name "Rosa's FloatVsDoubleBenchmark"
  (+ 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))))))