Average Error: 33.3 → 0.4
Time: 2.7m
Precision: 64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\frac{1 \cdot x}{y} \cdot \frac{\frac{1}{y}}{\frac{1}{x}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\frac{1 \cdot x}{y} \cdot \frac{\frac{1}{y}}{\frac{1}{x}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}
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) (((double) (1.0 * x)) / y)) * ((double) (((double) (1.0 / y)) / ((double) (1.0 / x)))))) + ((double) (((double) (((double) (z * 1.0)) / ((double) (t * 1.0)))) * ((double) (z / t))))));
}

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.4
\[{\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. Using strategy rm
  3. Applied times-frac19.0

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity19.0

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z \cdot z}{t \cdot \color{blue}{\left(1 \cdot t\right)}}\]
  6. Applied associate-*r*19.0

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z \cdot z}{\color{blue}{\left(t \cdot 1\right) \cdot t}}\]
  7. Applied *-un-lft-identity19.0

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

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{\color{blue}{\left(z \cdot 1\right) \cdot z}}{\left(t \cdot 1\right) \cdot t}\]
  9. Applied times-frac0.4

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}}\]
  10. Using strategy rm
  11. Applied clear-num0.4

    \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \cdot \frac{x}{y} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]
  12. Applied associate-*l/0.4

    \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{\frac{y}{x}}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]
  13. Using strategy rm
  14. Applied div-inv0.4

    \[\leadsto \frac{1 \cdot \frac{x}{y}}{\color{blue}{y \cdot \frac{1}{x}}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]
  15. Applied div-inv0.4

    \[\leadsto \frac{1 \cdot \color{blue}{\left(x \cdot \frac{1}{y}\right)}}{y \cdot \frac{1}{x}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]
  16. Applied associate-*r*0.4

    \[\leadsto \frac{\color{blue}{\left(1 \cdot x\right) \cdot \frac{1}{y}}}{y \cdot \frac{1}{x}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]
  17. Applied times-frac0.4

    \[\leadsto \color{blue}{\frac{1 \cdot x}{y} \cdot \frac{\frac{1}{y}}{\frac{1}{x}}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]
  18. Final simplification0.4

    \[\leadsto \frac{1 \cdot x}{y} \cdot \frac{\frac{1}{y}}{\frac{1}{x}} + \frac{z \cdot 1}{t \cdot 1} \cdot \frac{z}{t}\]

Reproduce

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