Average Error: 0.2 → 0.2
Time: 3.5s
Precision: binary64
\[\frac{x}{y \cdot 3}\]
\[\frac{x}{3 \cdot y}\]
\frac{x}{y \cdot 3}
\frac{x}{3 \cdot y}
(FPCore (x y) :precision binary64 (/ x (* y 3.0)))
(FPCore (x y) :precision binary64 (/ x (* 3.0 y)))
double code(double x, double y) {
	return x / (y * 3.0);
}
double code(double x, double y) {
	return x / (3.0 * y);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.2
Herbie0.2
\[\frac{\frac{x}{y}}{3}\]

Derivation

  1. Initial program 0.2

    \[\frac{x}{y \cdot 3}\]
  2. Using strategy rm
  3. Applied associate-/r*_binary64_204820.2

    \[\leadsto \color{blue}{\frac{\frac{x}{y}}{3}}\]
  4. Using strategy rm
  5. Applied associate-/l/_binary64_204850.2

    \[\leadsto \color{blue}{\frac{x}{3 \cdot y}}\]
  6. Final simplification0.2

    \[\leadsto \frac{x}{3 \cdot y}\]

Reproduce

herbie shell --seed 2021076 
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, C"
  :precision binary64

  :herbie-target
  (/ (/ x y) 3.0)

  (/ x (* y 3.0)))