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

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. Using strategy rm
  3. Applied associate-/l*_binary64_194600.3

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

    \[\leadsto \frac{1 - x}{\color{blue}{\frac{y}{\frac{3 - x}{3}}}}\]
  5. Using strategy rm
  6. Applied div-inv_binary64_195120.2

    \[\leadsto \frac{1 - x}{\color{blue}{y \cdot \frac{1}{\frac{3 - x}{3}}}}\]
  7. Simplified0.2

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

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

Reproduce

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