Average Error: 0.1 → 0
Time: 7.3s
Precision: 64
\[\left(\left(d1 \cdot d1\right) \cdot d1\right) \cdot d1\]
\[{d1}^{4}\]
\left(\left(d1 \cdot d1\right) \cdot d1\right) \cdot d1
{d1}^{4}
double f(double d1) {
        double r5007464 = d1;
        double r5007465 = r5007464 * r5007464;
        double r5007466 = r5007465 * r5007464;
        double r5007467 = r5007466 * r5007464;
        return r5007467;
}

double f(double d1) {
        double r5007468 = d1;
        double r5007469 = 4.0;
        double r5007470 = pow(r5007468, r5007469);
        return r5007470;
}

Error

Bits error versus d1

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0
Herbie0
\[{d1}^{4}\]

Derivation

  1. Initial program 0.1

    \[\left(\left(d1 \cdot d1\right) \cdot d1\right) \cdot d1\]
  2. Using strategy rm
  3. Applied pow20.1

    \[\leadsto \left(\color{blue}{{d1}^{2}} \cdot d1\right) \cdot d1\]
  4. Applied pow-plus0.1

    \[\leadsto \color{blue}{{d1}^{\left(2 + 1\right)}} \cdot d1\]
  5. Applied pow-plus0

    \[\leadsto \color{blue}{{d1}^{\left(\left(2 + 1\right) + 1\right)}}\]
  6. Simplified0

    \[\leadsto {d1}^{\color{blue}{4}}\]
  7. Final simplification0

    \[\leadsto {d1}^{4}\]

Reproduce

herbie shell --seed 2019138 +o rules:numerics
(FPCore (d1)
  :name "FastMath repmul"

  :herbie-target
  (pow d1 4)

  (* (* (* d1 d1) d1) d1))