Average Error: 5.5 → 0.1
Time: 6.6s
Precision: binary64
\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3} \]
\[\left(1 - x\right) \cdot \frac{1 - \frac{x}{3}}{y} \]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\left(1 - x\right) \cdot \frac{1 - \frac{x}{3}}{y}
(FPCore (x y) :precision binary64 (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))
(FPCore (x y) :precision binary64 (* (- 1.0 x) (/ (- 1.0 (/ x 3.0)) y)))
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) * ((1.0 - (x / 3.0)) / 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.5
Target0.1
Herbie0.1
\[\frac{1 - x}{y} \cdot \frac{3 - x}{3} \]

Derivation

  1. Initial program 5.5

    \[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3} \]
  2. Applied times-frac_binary640.1

    \[\leadsto \color{blue}{\frac{1 - x}{y} \cdot \frac{3 - x}{3}} \]
  3. Applied div-inv_binary640.2

    \[\leadsto \color{blue}{\left(\left(1 - x\right) \cdot \frac{1}{y}\right)} \cdot \frac{3 - x}{3} \]
  4. Applied associate-*l*_binary640.2

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

    \[\leadsto \left(1 - x\right) \cdot \color{blue}{\frac{\frac{3 - x}{3}}{y}} \]
  6. Applied div-sub_binary640.1

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

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

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

Reproduce

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