Average Error: 0.3 → 0.4
Time: 8.2s
Precision: 64
\[\left(x \cdot 27\right) \cdot y\]
\[\sqrt{27} \cdot \left(\left(\sqrt{27} \cdot x\right) \cdot y\right)\]
\left(x \cdot 27\right) \cdot y
\sqrt{27} \cdot \left(\left(\sqrt{27} \cdot x\right) \cdot y\right)
double f(double x, double y) {
        double r118800 = x;
        double r118801 = 27.0;
        double r118802 = r118800 * r118801;
        double r118803 = y;
        double r118804 = r118802 * r118803;
        return r118804;
}

double f(double x, double y) {
        double r118805 = 27.0;
        double r118806 = sqrt(r118805);
        double r118807 = x;
        double r118808 = r118806 * r118807;
        double r118809 = y;
        double r118810 = r118808 * r118809;
        double r118811 = r118806 * r118810;
        return r118811;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[\left(x \cdot 27\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*0.3

    \[\leadsto \color{blue}{x \cdot \left(27 \cdot y\right)}\]
  4. Taylor expanded around 0 0.3

    \[\leadsto \color{blue}{27 \cdot \left(x \cdot y\right)}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.3

    \[\leadsto \color{blue}{\left(\sqrt{27} \cdot \sqrt{27}\right)} \cdot \left(x \cdot y\right)\]
  7. Applied associate-*l*0.4

    \[\leadsto \color{blue}{\sqrt{27} \cdot \left(\sqrt{27} \cdot \left(x \cdot y\right)\right)}\]
  8. Using strategy rm
  9. Applied associate-*r*0.4

    \[\leadsto \sqrt{27} \cdot \color{blue}{\left(\left(\sqrt{27} \cdot x\right) \cdot y\right)}\]
  10. Final simplification0.4

    \[\leadsto \sqrt{27} \cdot \left(\left(\sqrt{27} \cdot x\right) \cdot y\right)\]

Reproduce

herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, F"
  :precision binary64
  (* (* x 27) y))