Average Error: 33.3 → 0.5
Time: 5.1s
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) \cdot \sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}}\right) \cdot {\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{3}{4}}\]
\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) \cdot \sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}}\right) \cdot {\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{3}{4}}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (((double) (x * x)) / ((double) (y * y)))) + ((double) (((double) (z * z)) / ((double) (t * t))))));
}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (((double) hypot(((double) (z / t)), ((double) (x / y)))) * ((double) sqrt(((double) sqrt(((double) hypot(((double) (z / t)), ((double) (x / y)))))))))) * ((double) pow(((double) hypot(((double) (z / t)), ((double) (x / y)))), 0.75))));
}

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

Derivation

  1. Initial program 33.3

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

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

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

    \[\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. Using strategy rm
  10. Applied add-sqr-sqrt0.6

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

    \[\leadsto \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right) \cdot \left(\color{blue}{\left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}} \cdot \sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}}\right)} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)\]
  12. Applied associate-*l*0.7

    \[\leadsto \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right) \cdot \color{blue}{\left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}} \cdot \left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)\right)}\]
  13. Applied associate-*r*0.7

    \[\leadsto \color{blue}{\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right) \cdot \sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}}\right) \cdot \left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)}\]
  14. Using strategy rm
  15. Applied pow1/20.7

    \[\leadsto \left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right) \cdot \sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}}\right) \cdot \left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}} \cdot \color{blue}{{\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{1}{2}}}\right)\]
  16. Applied pow1/20.7

    \[\leadsto \left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right) \cdot \sqrt{\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}}\right) \cdot \left(\sqrt{\color{blue}{{\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{1}{2}}}} \cdot {\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{1}{2}}\right)\]
  17. Applied sqrt-pow10.6

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

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

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

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

Reproduce

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