Average Error: 5.5 → 0.1
Time: 3.4s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)\]
x \cdot \left(1 + y \cdot y\right)
\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)
double f(double x, double y) {
        double r477125 = x;
        double r477126 = 1.0;
        double r477127 = y;
        double r477128 = r477127 * r477127;
        double r477129 = r477126 + r477128;
        double r477130 = r477125 * r477129;
        return r477130;
}

double f(double x, double y) {
        double r477131 = 1.0;
        double r477132 = sqrt(r477131);
        double r477133 = y;
        double r477134 = hypot(r477132, r477133);
        double r477135 = x;
        double r477136 = r477135 * r477134;
        double r477137 = r477134 * r477136;
        return r477137;
}

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 add-sqr-sqrt5.6

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)} \cdot \sqrt{\sqrt{1 + y \cdot y}}\]
  10. Using strategy rm
  11. Applied pow15.6

    \[\leadsto \left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right) \cdot \color{blue}{{\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}}\]
  12. Applied pow15.6

    \[\leadsto \left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \color{blue}{{\left(\mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}}\right) \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  13. Applied pow15.6

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

    \[\leadsto \left(\left(\color{blue}{{x}^{1}} \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\right) \cdot {\left(\mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  15. Applied pow-prod-down5.6

    \[\leadsto \left(\color{blue}{{\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}} \cdot {\left(\mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  16. Applied pow-prod-down5.6

    \[\leadsto \color{blue}{{\left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}} \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  17. Applied pow-prod-down5.6

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

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

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

Reproduce

herbie shell --seed 2020021 +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))))