Average Error: 10.3 → 0.2
Time: 8.4s
Precision: 64
\[pi \cdot {x}^{2}\]
\[\left(pi \cdot {x}^{\left(\frac{2}{2}\right)}\right) \cdot {x}^{\left(\frac{2}{2}\right)}\]
pi \cdot {x}^{2}
\left(pi \cdot {x}^{\left(\frac{2}{2}\right)}\right) \cdot {x}^{\left(\frac{2}{2}\right)}
double f(double pi, double x) {
        double r3481591 = pi;
        double r3481592 = x;
        double r3481593 = 2.0;
        double r3481594 = pow(r3481592, r3481593);
        double r3481595 = r3481591 * r3481594;
        return r3481595;
}

double f(double pi, double x) {
        double r3481596 = pi;
        double r3481597 = x;
        double r3481598 = 2.0;
        double r3481599 = 2.0;
        double r3481600 = r3481598 / r3481599;
        double r3481601 = pow(r3481597, r3481600);
        double r3481602 = r3481596 * r3481601;
        double r3481603 = r3481602 * r3481601;
        return r3481603;
}

Error

Bits error versus pi

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 10.3

    \[pi \cdot {x}^{2}\]
  2. Using strategy rm
  3. Applied sqr-pow10.3

    \[\leadsto pi \cdot \color{blue}{\left({x}^{\left(\frac{2}{2}\right)} \cdot {x}^{\left(\frac{2}{2}\right)}\right)}\]
  4. Applied associate-*r*0.2

    \[\leadsto \color{blue}{\left(pi \cdot {x}^{\left(\frac{2}{2}\right)}\right) \cdot {x}^{\left(\frac{2}{2}\right)}}\]
  5. Final simplification0.2

    \[\leadsto \left(pi \cdot {x}^{\left(\frac{2}{2}\right)}\right) \cdot {x}^{\left(\frac{2}{2}\right)}\]

Reproduce

herbie shell --seed 1 
(FPCore (pi x)
  :name "pi*x^2"
  :precision binary64
  (* pi (pow x 2)))