Average Error: 33.7 → 0.7
Time: 4.7s
Precision: 64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\left(\sqrt[3]{{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)}^{3}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right) \cdot \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\left(\sqrt[3]{{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)}^{3}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right) \cdot \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)
double f(double x, double y, double z, double t) {
        double r656598 = x;
        double r656599 = r656598 * r656598;
        double r656600 = y;
        double r656601 = r656600 * r656600;
        double r656602 = r656599 / r656601;
        double r656603 = z;
        double r656604 = r656603 * r656603;
        double r656605 = t;
        double r656606 = r656605 * r656605;
        double r656607 = r656604 / r656606;
        double r656608 = r656602 + r656607;
        return r656608;
}

double f(double x, double y, double z, double t) {
        double r656609 = z;
        double r656610 = t;
        double r656611 = r656609 / r656610;
        double r656612 = x;
        double r656613 = y;
        double r656614 = r656612 / r656613;
        double r656615 = hypot(r656611, r656614);
        double r656616 = sqrt(r656615);
        double r656617 = 3.0;
        double r656618 = pow(r656616, r656617);
        double r656619 = cbrt(r656618);
        double r656620 = r656619 * r656616;
        double r656621 = r656620 * r656615;
        return r656621;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original33.7
Target0.4
Herbie0.7
\[{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}\]

Derivation

  1. Initial program 33.7

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
  2. Simplified19.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, \frac{z}{t}, \frac{x \cdot x}{y \cdot y}\right)}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt19.2

    \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(\frac{z}{t}, \frac{z}{t}, \frac{x \cdot x}{y \cdot y}\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{z}{t}, \frac{z}{t}, \frac{x \cdot x}{y \cdot y}\right)}}\]
  5. Simplified19.2

    \[\leadsto \color{blue}{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{z}{t}, \frac{z}{t}, \frac{x \cdot x}{y \cdot y}\right)}\]
  6. Simplified0.4

    \[\leadsto \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right) \cdot \color{blue}{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.6

    \[\leadsto \color{blue}{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)} \cdot \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\]
  9. Using strategy rm
  10. Applied add-cbrt-cube0.7

    \[\leadsto \left(\color{blue}{\sqrt[3]{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right) \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right) \cdot \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\]
  11. Simplified0.7

    \[\leadsto \left(\sqrt[3]{\color{blue}{{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)}^{3}}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right) \cdot \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\]
  12. Final simplification0.7

    \[\leadsto \left(\sqrt[3]{{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)}^{3}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right) \cdot \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\]

Reproduce

herbie shell --seed 2020033 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
  :precision binary64

  :herbie-target
  (+ (pow (/ x y) 2) (pow (/ z t) 2))

  (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))