Average Error: 22.0 → 16.1
Time: 12.4s
Precision: 64
\[\frac{{x}^{2}}{2 \cdot {a}^{2}}\]
\[\frac{{x}^{\left(\frac{2}{2}\right)}}{\frac{2 \cdot {a}^{2}}{{x}^{\left(\frac{2}{2}\right)}}}\]
\frac{{x}^{2}}{2 \cdot {a}^{2}}
\frac{{x}^{\left(\frac{2}{2}\right)}}{\frac{2 \cdot {a}^{2}}{{x}^{\left(\frac{2}{2}\right)}}}
double f(double x, double a) {
        double r34137 = x;
        double r34138 = 2.0;
        double r34139 = pow(r34137, r34138);
        double r34140 = a;
        double r34141 = pow(r34140, r34138);
        double r34142 = r34138 * r34141;
        double r34143 = r34139 / r34142;
        return r34143;
}

double f(double x, double a) {
        double r34144 = x;
        double r34145 = 2.0;
        double r34146 = 2.0;
        double r34147 = r34145 / r34146;
        double r34148 = pow(r34144, r34147);
        double r34149 = a;
        double r34150 = pow(r34149, r34145);
        double r34151 = r34145 * r34150;
        double r34152 = r34151 / r34148;
        double r34153 = r34148 / r34152;
        return r34153;
}

Error

Bits error versus x

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 22.0

    \[\frac{{x}^{2}}{2 \cdot {a}^{2}}\]
  2. Using strategy rm
  3. Applied sqr-pow22.0

    \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{2}{2}\right)} \cdot {x}^{\left(\frac{2}{2}\right)}}}{2 \cdot {a}^{2}}\]
  4. Applied associate-/l*16.1

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

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

Reproduce

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