Average Error: 0.2 → 0.3
Time: 1.2s
Precision: 64
\[\frac{x}{y \cdot 3}\]
\[x \cdot \frac{1}{y \cdot 3}\]
\frac{x}{y \cdot 3}
x \cdot \frac{1}{y \cdot 3}
double code(double x, double y) {
	return (x / (y * 3.0));
}
double code(double x, double y) {
	return (x * (1.0 / (y * 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.2
Target0.3
Herbie0.3
\[\frac{\frac{x}{y}}{3}\]

Derivation

  1. Initial program 0.2

    \[\frac{x}{y \cdot 3}\]
  2. Using strategy rm
  3. Applied div-inv0.3

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

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

Reproduce

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

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

  (/ x (* y 3)))