Average Error: 33.9 → 0.7
Time: 12.2s
Precision: 64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}} \cdot \sqrt{\left|\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right| \cdot \sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}}\right) \cdot \sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}} \cdot \sqrt{\left|\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right| \cdot \sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}}\right) \cdot \sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)
double f(double x, double y, double z, double t) {
        double r757435 = x;
        double r757436 = r757435 * r757435;
        double r757437 = y;
        double r757438 = r757437 * r757437;
        double r757439 = r757436 / r757438;
        double r757440 = z;
        double r757441 = r757440 * r757440;
        double r757442 = t;
        double r757443 = r757442 * r757442;
        double r757444 = r757441 / r757443;
        double r757445 = r757439 + r757444;
        return r757445;
}

double f(double x, double y, double z, double t) {
        double r757446 = x;
        double r757447 = y;
        double r757448 = r757446 / r757447;
        double r757449 = z;
        double r757450 = t;
        double r757451 = r757449 / r757450;
        double r757452 = hypot(r757448, r757451);
        double r757453 = sqrt(r757452);
        double r757454 = sqrt(r757453);
        double r757455 = cbrt(r757452);
        double r757456 = fabs(r757455);
        double r757457 = sqrt(r757455);
        double r757458 = r757456 * r757457;
        double r757459 = sqrt(r757458);
        double r757460 = r757454 * r757459;
        double r757461 = r757460 * r757453;
        double r757462 = r757452 * r757461;
        return r757462;
}

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.9
Target0.4
Herbie0.7
\[{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}\]

Derivation

  1. Initial program 33.9

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

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

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

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

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

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

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

    \[\leadsto \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\color{blue}{\left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}} \cdot \sqrt{\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}\right)} \cdot \sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)\]
  12. Using strategy rm
  13. Applied add-cube-cbrt0.7

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

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

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

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

Reproduce

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