Average Error: 6.0 → 0.2
Time: 5.7s
Precision: binary64
\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
\[\frac{\frac{1 - x}{y} \cdot \left(3 - x\right)}{3}\]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\frac{\frac{1 - x}{y} \cdot \left(3 - x\right)}{3}
double code(double x, double y) {
	return (((double) (((double) (1.0 - x)) * ((double) (3.0 - x)))) / ((double) (y * 3.0)));
}
double code(double x, double y) {
	return (((double) ((((double) (1.0 - x)) / y) * ((double) (3.0 - 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

Original6.0
Target0.1
Herbie0.2
\[\frac{1 - x}{y} \cdot \frac{3 - x}{3}\]

Derivation

  1. Initial program 6.0

    \[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
  2. Using strategy rm
  3. Applied associate-/r*5.9

    \[\leadsto \color{blue}{\frac{\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y}}{3}}\]
  4. Simplified0.2

    \[\leadsto \frac{\color{blue}{\frac{1 - x}{y} \cdot \left(3 - x\right)}}{3}\]
  5. Final simplification0.2

    \[\leadsto \frac{\frac{1 - x}{y} \cdot \left(3 - x\right)}{3}\]

Reproduce

herbie shell --seed 2020182 
(FPCore (x y)
  :name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
  :precision binary64

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

  (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))