Average Error: 5.8 → 0.1
Time: 13.8s
Precision: 64
\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
\[\frac{\frac{1 - x}{y}}{\frac{3}{3 - x}}\]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\frac{\frac{1 - x}{y}}{\frac{3}{3 - x}}
double f(double x, double y) {
        double r18189099 = 1.0;
        double r18189100 = x;
        double r18189101 = r18189099 - r18189100;
        double r18189102 = 3.0;
        double r18189103 = r18189102 - r18189100;
        double r18189104 = r18189101 * r18189103;
        double r18189105 = y;
        double r18189106 = r18189105 * r18189102;
        double r18189107 = r18189104 / r18189106;
        return r18189107;
}

double f(double x, double y) {
        double r18189108 = 1.0;
        double r18189109 = x;
        double r18189110 = r18189108 - r18189109;
        double r18189111 = y;
        double r18189112 = r18189110 / r18189111;
        double r18189113 = 3.0;
        double r18189114 = r18189113 - r18189109;
        double r18189115 = r18189113 / r18189114;
        double r18189116 = r18189112 / r18189115;
        return r18189116;
}

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.8
Target0.1
Herbie0.1
\[\frac{1 - x}{y} \cdot \frac{3 - x}{3}\]

Derivation

  1. Initial program 5.8

    \[\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. Using strategy rm
  5. Applied *-un-lft-identity0.3

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

    \[\leadsto \frac{1 - x}{\color{blue}{\frac{y}{1} \cdot \frac{3}{3 - x}}}\]
  7. Applied associate-/r*0.1

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

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

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

Reproduce

herbie shell --seed 2019171 
(FPCore (x y)
  :name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"

  :herbie-target
  (* (/ (- 1.0 x) y) (/ (- 3.0 x) 3.0))

  (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))