Average Error: 34.0 → 0.5
Time: 4.0s
Precision: 64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[{\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{3}{2}} \cdot \sqrt{\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(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{3}{2}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}
double f(double x, double y, double z, double t) {
        double r651693 = x;
        double r651694 = r651693 * r651693;
        double r651695 = y;
        double r651696 = r651695 * r651695;
        double r651697 = r651694 / r651696;
        double r651698 = z;
        double r651699 = r651698 * r651698;
        double r651700 = t;
        double r651701 = r651700 * r651700;
        double r651702 = r651699 / r651701;
        double r651703 = r651697 + r651702;
        return r651703;
}

double f(double x, double y, double z, double t) {
        double r651704 = z;
        double r651705 = t;
        double r651706 = r651704 / r651705;
        double r651707 = x;
        double r651708 = y;
        double r651709 = r651707 / r651708;
        double r651710 = hypot(r651706, r651709);
        double r651711 = 1.5;
        double r651712 = pow(r651710, r651711);
        double r651713 = sqrt(r651710);
        double r651714 = r651712 * r651713;
        return r651714;
}

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

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

Derivation

  1. Initial program 34.0

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

    \[\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.7

    \[\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.6

    \[\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 \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right) \cdot \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)}\]
  9. Applied associate-*r*0.6

    \[\leadsto \color{blue}{\left(\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)}}\]
  10. Simplified0.8

    \[\leadsto \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)}\]
  11. Using strategy rm
  12. Applied pow1/20.8

    \[\leadsto {\color{blue}{\left({\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{1}{2}}\right)}}^{3} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\]
  13. Applied pow-pow0.5

    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\left(\frac{1}{2} \cdot 3\right)}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\]
  14. Simplified0.5

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

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

Reproduce

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