Average Error: 5.5 → 0.1
Time: 3.1s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[\left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\]
x \cdot \left(1 + y \cdot y\right)
\left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)
double f(double x, double y) {
        double r489540 = x;
        double r489541 = 1.0;
        double r489542 = y;
        double r489543 = r489542 * r489542;
        double r489544 = r489541 + r489543;
        double r489545 = r489540 * r489544;
        return r489545;
}

double f(double x, double y) {
        double r489546 = x;
        double r489547 = 1.0;
        double r489548 = sqrt(r489547);
        double r489549 = y;
        double r489550 = hypot(r489548, r489549);
        double r489551 = r489546 * r489550;
        double r489552 = r489551 * r489550;
        return r489552;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.5
Target0.1
Herbie0.1
\[x + \left(x \cdot y\right) \cdot y\]

Derivation

  1. Initial program 5.5

    \[x \cdot \left(1 + y \cdot y\right)\]
  2. Using strategy rm
  3. Applied *-commutative5.5

    \[\leadsto \color{blue}{\left(1 + y \cdot y\right) \cdot x}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt5.5

    \[\leadsto \color{blue}{\left(\sqrt{1 + y \cdot y} \cdot \sqrt{1 + y \cdot y}\right)} \cdot x\]
  6. Applied associate-*l*5.5

    \[\leadsto \color{blue}{\sqrt{1 + y \cdot y} \cdot \left(\sqrt{1 + y \cdot y} \cdot x\right)}\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt5.5

    \[\leadsto \sqrt{\color{blue}{\sqrt{1 + y \cdot y} \cdot \sqrt{1 + y \cdot y}}} \cdot \left(\sqrt{1 + y \cdot y} \cdot x\right)\]
  9. Applied sqrt-prod5.6

    \[\leadsto \color{blue}{\left(\sqrt{\sqrt{1 + y \cdot y}} \cdot \sqrt{\sqrt{1 + y \cdot y}}\right)} \cdot \left(\sqrt{1 + y \cdot y} \cdot x\right)\]
  10. Applied associate-*l*5.6

    \[\leadsto \color{blue}{\sqrt{\sqrt{1 + y \cdot y}} \cdot \left(\sqrt{\sqrt{1 + y \cdot y}} \cdot \left(\sqrt{1 + y \cdot y} \cdot x\right)\right)}\]
  11. Simplified5.6

    \[\leadsto \sqrt{\sqrt{1 + y \cdot y}} \cdot \color{blue}{\left(\left(\sqrt{\sqrt{1 + y \cdot y}} \cdot x\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)}\]
  12. Using strategy rm
  13. Applied associate-*r*5.6

    \[\leadsto \color{blue}{\left(\sqrt{\sqrt{1 + y \cdot y}} \cdot \left(\sqrt{\sqrt{1 + y \cdot y}} \cdot x\right)\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)}\]
  14. Simplified0.1

    \[\leadsto \color{blue}{\left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)} \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\]
  15. Final simplification0.1

    \[\leadsto \left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\]

Reproduce

herbie shell --seed 2020002 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"
  :precision binary64

  :herbie-target
  (+ x (* (* x y) y))

  (* x (+ 1 (* y y))))