Average Error: 5.6 → 0.2
Time: 2.4s
Precision: binary64
\[\]
\[\]
double code(double x, double y) {
	return ((double) (((double) (((double) (1.0 - x)) * ((double) (3.0 - x)))) / ((double) (y * 3.0))));
}
double code(double x, double y) {
	return ((double) (((double) (1.0 / y)) + ((double) (((double) (0.3333333333333333 * ((double) (x / ((double) (y / x)))))) - ((double) (((double) (x / y)) * 1.3333333333333333))))));
}

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.6
Target0.1
Herbie0.2
\[\]

Derivation

  1. Initial program 5.6

    \[\]
  2. Simplified0.3

    \[\leadsto \]
  3. Taylor expanded around 0 5.4

    \[\leadsto \]
  4. Simplified0.2

    \[\leadsto \]
  5. Final simplification0.2

    \[\leadsto \]

Reproduce

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