Average Error: 34.1 → 0.4
Time: 15.4s
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

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

Derivation

  1. Initial program 34.1

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

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

    \[\leadsto \frac{x}{y} \cdot \color{blue}{{\left(\frac{x}{y}\right)}^{1}} + \frac{z}{t} \cdot \frac{z}{t}\]
  5. Applied pow1_binary64_124150.4

    \[\leadsto \color{blue}{{\left(\frac{x}{y}\right)}^{1}} \cdot {\left(\frac{x}{y}\right)}^{1} + \frac{z}{t} \cdot \frac{z}{t}\]
  6. Applied pow-prod-up_binary64_124240.4

    \[\leadsto \color{blue}{{\left(\frac{x}{y}\right)}^{\left(1 + 1\right)}} + \frac{z}{t} \cdot \frac{z}{t}\]
  7. Simplified0.4

    \[\leadsto {\left(\frac{x}{y}\right)}^{\color{blue}{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 2021176 
(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))))