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

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

Derivation

  1. Initial program 5.7

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

    \[\leadsto \color{blue}{\left(1 - x\right) \cdot \frac{3 - x}{3 \cdot y}}\]
  3. Using strategy rm
  4. Applied clear-num0.3

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

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

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

Reproduce

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