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

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.3
Target0.3
Herbie0.3
\[\frac{\frac{x}{y}}{3}\]

Derivation

  1. Initial program Error: 0.3 bits

    \[\frac{x}{y \cdot 3}\]
  2. Using strategy rm
  3. Applied *-un-lft-identityError: 0.3 bits

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot 3}\]
  4. Applied times-fracError: 0.3 bits

    \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{3}}\]
  5. Final simplificationError: 0.3 bits

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

Reproduce

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