Average Error: 5.7 → 0.2
Time: 8.7s
Precision: 64
\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
\[\frac{1}{\frac{y \cdot \frac{3}{3 - x}}{1 - x}}\]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\frac{1}{\frac{y \cdot \frac{3}{3 - x}}{1 - x}}
double f(double x, double y) {
        double r734336 = 1.0;
        double r734337 = x;
        double r734338 = r734336 - r734337;
        double r734339 = 3.0;
        double r734340 = r734339 - r734337;
        double r734341 = r734338 * r734340;
        double r734342 = y;
        double r734343 = r734342 * r734339;
        double r734344 = r734341 / r734343;
        return r734344;
}

double f(double x, double y) {
        double r734345 = 1.0;
        double r734346 = y;
        double r734347 = 3.0;
        double r734348 = x;
        double r734349 = r734347 - r734348;
        double r734350 = r734347 / r734349;
        double r734351 = r734346 * r734350;
        double r734352 = 1.0;
        double r734353 = r734352 - r734348;
        double r734354 = r734351 / r734353;
        double r734355 = r734345 / r734354;
        return r734355;
}

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*0.3

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

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

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

    \[\leadsto \frac{1}{\frac{y \cdot \frac{3}{3 - x}}{1 - x}}\]

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
  :precision binary64

  :herbie-target
  (* (/ (- 1 x) y) (/ (- 3 x) 3))

  (/ (* (- 1 x) (- 3 x)) (* y 3)))