Average Error: 0.5 → 0.5
Time: 50.2s
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(\frac{\left(x1 \cdot x1\right) \cdot 3 - \left(x1 - -2 \cdot x2\right)}{1 + x1 \cdot x1} \cdot 3 + x1\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) + \left(\frac{1}{1 + x1 \cdot x1} \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(\left(\left(1 + x1 \cdot x1\right) \cdot 2\right) \cdot \left(\frac{\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)}{1 + x1 \cdot x1} - 3\right)\right) \cdot x1\right)\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)\right)\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(\frac{\left(x1 \cdot x1\right) \cdot 3 - \left(x1 - -2 \cdot x2\right)}{1 + x1 \cdot x1} \cdot 3 + x1\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) + \left(\frac{1}{1 + x1 \cdot x1} \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(\left(\left(1 + x1 \cdot x1\right) \cdot 2\right) \cdot \left(\frac{\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)}{1 + x1 \cdot x1} - 3\right)\right) \cdot x1\right)\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)\right)\right)
double f(double x1, double x2) {
        double r3280356 = x1;
        double r3280357 = 2.0;
        double r3280358 = r3280357 * r3280356;
        double r3280359 = 3.0;
        double r3280360 = r3280359 * r3280356;
        double r3280361 = r3280360 * r3280356;
        double r3280362 = x2;
        double r3280363 = r3280357 * r3280362;
        double r3280364 = r3280361 + r3280363;
        double r3280365 = r3280364 - r3280356;
        double r3280366 = r3280356 * r3280356;
        double r3280367 = 1.0;
        double r3280368 = r3280366 + r3280367;
        double r3280369 = r3280365 / r3280368;
        double r3280370 = r3280358 * r3280369;
        double r3280371 = r3280369 - r3280359;
        double r3280372 = r3280370 * r3280371;
        double r3280373 = 4.0;
        double r3280374 = r3280373 * r3280369;
        double r3280375 = 6.0;
        double r3280376 = r3280374 - r3280375;
        double r3280377 = r3280366 * r3280376;
        double r3280378 = r3280372 + r3280377;
        double r3280379 = r3280378 * r3280368;
        double r3280380 = r3280361 * r3280369;
        double r3280381 = r3280379 + r3280380;
        double r3280382 = r3280366 * r3280356;
        double r3280383 = r3280381 + r3280382;
        double r3280384 = r3280383 + r3280356;
        double r3280385 = r3280361 - r3280363;
        double r3280386 = r3280385 - r3280356;
        double r3280387 = r3280386 / r3280368;
        double r3280388 = r3280359 * r3280387;
        double r3280389 = r3280384 + r3280388;
        double r3280390 = r3280356 + r3280389;
        return r3280390;
}

double f(double x1, double x2) {
        double r3280391 = x1;
        double r3280392 = r3280391 * r3280391;
        double r3280393 = 3.0;
        double r3280394 = r3280392 * r3280393;
        double r3280395 = -2.0;
        double r3280396 = x2;
        double r3280397 = r3280395 * r3280396;
        double r3280398 = r3280391 - r3280397;
        double r3280399 = r3280394 - r3280398;
        double r3280400 = 1.0;
        double r3280401 = r3280400 + r3280392;
        double r3280402 = r3280399 / r3280401;
        double r3280403 = r3280402 * r3280393;
        double r3280404 = r3280403 + r3280391;
        double r3280405 = 4.0;
        double r3280406 = 2.0;
        double r3280407 = r3280406 * r3280396;
        double r3280408 = r3280407 - r3280391;
        double r3280409 = r3280394 + r3280408;
        double r3280410 = r3280405 * r3280409;
        double r3280411 = r3280410 / r3280401;
        double r3280412 = 6.0;
        double r3280413 = r3280411 - r3280412;
        double r3280414 = r3280391 * r3280413;
        double r3280415 = r3280414 * r3280391;
        double r3280416 = r3280415 + r3280391;
        double r3280417 = r3280416 * r3280401;
        double r3280418 = r3280400 / r3280401;
        double r3280419 = r3280401 * r3280406;
        double r3280420 = r3280409 / r3280401;
        double r3280421 = r3280420 - r3280393;
        double r3280422 = r3280419 * r3280421;
        double r3280423 = r3280422 * r3280391;
        double r3280424 = r3280394 + r3280423;
        double r3280425 = r3280418 * r3280424;
        double r3280426 = r3280425 * r3280409;
        double r3280427 = r3280417 + r3280426;
        double r3280428 = r3280404 + r3280427;
        return r3280428;
}

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. Using strategy rm
  6. Applied div-inv0.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(\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) + \color{blue}{\left(\left(\left(x1 \cdot x1\right) \cdot 3 + \left(x2 \cdot 2 - x1\right)\right) \cdot \frac{1}{1 + x1 \cdot x1}\right)} \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)\]
  7. Applied associate-*l*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(\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) + \color{blue}{\left(\left(x1 \cdot x1\right) \cdot 3 + \left(x2 \cdot 2 - x1\right)\right) \cdot \left(\frac{1}{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)}\right)\]
  8. Final simplification0.5

    \[\leadsto \left(\frac{\left(x1 \cdot x1\right) \cdot 3 - \left(x1 - -2 \cdot x2\right)}{1 + x1 \cdot x1} \cdot 3 + x1\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) + \left(\frac{1}{1 + x1 \cdot x1} \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(\left(\left(1 + x1 \cdot x1\right) \cdot 2\right) \cdot \left(\frac{\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)}{1 + x1 \cdot x1} - 3\right)\right) \cdot x1\right)\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 3 + \left(2 \cdot x2 - x1\right)\right)\right)\]

Reproduce

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