Average Error: 33.8 → 0.4
Time: 9.5s
Precision: binary64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[{\left(\frac{x}{y}\right)}^{2} + \frac{z}{t} \cdot \frac{z}{t}\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
{\left(\frac{x}{y}\right)}^{2} + \frac{z}{t} \cdot \frac{z}{t}
(FPCore (x y z t)
 :precision binary64
 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
(FPCore (x y z t)
 :precision binary64
 (+ (pow (/ x y) 2.0) (* (/ z t) (/ z t))))
double code(double x, double y, double z, double t) {
	return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
double code(double x, double y, double z, double t) {
	return pow((x / y), 2.0) + ((z / t) * (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.8
Target0.4
Herbie0.4
\[{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}\]

Derivation

  1. Initial program 33.8

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
  2. Using strategy rm
  3. Applied times-frac_binary64_1815719.4

    \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\]
  4. Using strategy rm
  5. Applied times-frac_binary64_181570.4

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z}{t} \cdot \frac{z}{t}\]
  6. Using strategy rm
  7. Applied pow2_binary64_182320.4

    \[\leadsto \color{blue}{{\left(\frac{x}{y}\right)}^{2}} + \frac{z}{t} \cdot \frac{z}{t}\]
  8. Final simplification0.4

    \[\leadsto {\left(\frac{x}{y}\right)}^{2} + \frac{z}{t} \cdot \frac{z}{t}\]

Reproduce

herbie shell --seed 2021044 
(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.0) (pow (/ z t) 2.0))

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