Average Error: 0.5 → 0.5
Time: 4.0m
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)\]
\[x1 + \mathsf{fma}\left(3, \left(\frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \left(x1 + \mathsf{fma}\left(x1, \left(x1 \cdot x1\right), \left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \left(x1 \cdot \left(x1 \cdot 3\right)\right), \left(\left(\left(\sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), 4, -6\right)\right), \left(x1 \cdot x1\right), \left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(2 \cdot x1\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), 4, -6\right)\right), \left(x1 \cdot x1\right), \left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(2 \cdot x1\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), 4, -6\right)\right), \left(x1 \cdot x1\right), \left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(2 \cdot x1\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right)\right)\right)}\right) \cdot \mathsf{fma}\left(x1, x1, 1\right)\right)\right)\right)\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)
x1 + \mathsf{fma}\left(3, \left(\frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \left(x1 + \mathsf{fma}\left(x1, \left(x1 \cdot x1\right), \left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \left(x1 \cdot \left(x1 \cdot 3\right)\right), \left(\left(\left(\sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), 4, -6\right)\right), \left(x1 \cdot x1\right), \left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(2 \cdot x1\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), 4, -6\right)\right), \left(x1 \cdot x1\right), \left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(2 \cdot x1\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), 4, -6\right)\right), \left(x1 \cdot x1\right), \left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(2 \cdot x1\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x2, 2, \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right)\right)\right)}\right) \cdot \mathsf{fma}\left(x1, x1, 1\right)\right)\right)\right)\right)\right)\right)
double f(double x1, double x2) {
        double r21366221 = x1;
        double r21366222 = 2.0;
        double r21366223 = r21366222 * r21366221;
        double r21366224 = 3.0;
        double r21366225 = r21366224 * r21366221;
        double r21366226 = r21366225 * r21366221;
        double r21366227 = x2;
        double r21366228 = r21366222 * r21366227;
        double r21366229 = r21366226 + r21366228;
        double r21366230 = r21366229 - r21366221;
        double r21366231 = r21366221 * r21366221;
        double r21366232 = 1.0;
        double r21366233 = r21366231 + r21366232;
        double r21366234 = r21366230 / r21366233;
        double r21366235 = r21366223 * r21366234;
        double r21366236 = r21366234 - r21366224;
        double r21366237 = r21366235 * r21366236;
        double r21366238 = 4.0;
        double r21366239 = r21366238 * r21366234;
        double r21366240 = 6.0;
        double r21366241 = r21366239 - r21366240;
        double r21366242 = r21366231 * r21366241;
        double r21366243 = r21366237 + r21366242;
        double r21366244 = r21366243 * r21366233;
        double r21366245 = r21366226 * r21366234;
        double r21366246 = r21366244 + r21366245;
        double r21366247 = r21366231 * r21366221;
        double r21366248 = r21366246 + r21366247;
        double r21366249 = r21366248 + r21366221;
        double r21366250 = r21366226 - r21366228;
        double r21366251 = r21366250 - r21366221;
        double r21366252 = r21366251 / r21366233;
        double r21366253 = r21366224 * r21366252;
        double r21366254 = r21366249 + r21366253;
        double r21366255 = r21366221 + r21366254;
        return r21366255;
}

double f(double x1, double x2) {
        double r21366256 = x1;
        double r21366257 = 3.0;
        double r21366258 = r21366256 * r21366257;
        double r21366259 = r21366256 * r21366258;
        double r21366260 = 2.0;
        double r21366261 = x2;
        double r21366262 = fma(r21366260, r21366261, r21366256);
        double r21366263 = r21366259 - r21366262;
        double r21366264 = 1.0;
        double r21366265 = fma(r21366256, r21366256, r21366264);
        double r21366266 = r21366263 / r21366265;
        double r21366267 = r21366256 * r21366256;
        double r21366268 = fma(r21366261, r21366260, r21366259);
        double r21366269 = r21366268 - r21366256;
        double r21366270 = r21366269 / r21366265;
        double r21366271 = 4.0;
        double r21366272 = -6.0;
        double r21366273 = fma(r21366270, r21366271, r21366272);
        double r21366274 = r21366260 * r21366256;
        double r21366275 = r21366270 * r21366274;
        double r21366276 = r21366270 - r21366257;
        double r21366277 = r21366275 * r21366276;
        double r21366278 = fma(r21366273, r21366267, r21366277);
        double r21366279 = cbrt(r21366278);
        double r21366280 = r21366279 * r21366279;
        double r21366281 = r21366280 * r21366279;
        double r21366282 = r21366281 * r21366265;
        double r21366283 = fma(r21366270, r21366259, r21366282);
        double r21366284 = fma(r21366256, r21366267, r21366283);
        double r21366285 = r21366256 + r21366284;
        double r21366286 = fma(r21366257, r21366266, r21366285);
        double r21366287 = r21366256 + r21366286;
        return r21366287;
}

Error

Bits error versus x1

Bits error versus x2

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.3

    \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \left(\frac{\left(3 \cdot x1\right) \cdot x1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \left(\mathsf{fma}\left(x1, \left(x1 \cdot x1\right), \left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(\left(3 \cdot x1\right) \cdot x1\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \left(\left(3 \cdot x1\right) \cdot x1\right), \left(\mathsf{fma}\left(x1, x1, 1\right) \cdot \mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(\left(3 \cdot x1\right) \cdot x1\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), 4, -6\right)\right), \left(x1 \cdot x1\right), \left(\left(\frac{\mathsf{fma}\left(x2, 2, \left(\left(3 \cdot x1\right) \cdot x1\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{\mathsf{fma}\left(x2, 2, \left(\left(3 \cdot x1\right) \cdot x1\right)\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\right)\right)\right) + x1\right)\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.5

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

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

Reproduce

herbie shell --seed 2019121 +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))))))